@scaleflex/uploader 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +1 -1
  3. package/dist/auth/auth.service.d.ts.map +1 -1
  4. package/dist/components/actions-bar.d.ts +4 -1
  5. package/dist/components/actions-bar.d.ts.map +1 -1
  6. package/dist/components/camera-dialog.d.ts +2 -1
  7. package/dist/components/camera-dialog.d.ts.map +1 -1
  8. package/dist/components/drop-zone.d.ts +17 -0
  9. package/dist/components/drop-zone.d.ts.map +1 -1
  10. package/dist/components/file-item.d.ts.map +1 -1
  11. package/dist/components/file-list.d.ts.map +1 -1
  12. package/dist/components/provider-browser.d.ts +1 -0
  13. package/dist/components/provider-browser.d.ts.map +1 -1
  14. package/dist/components/screen-cast-dialog.d.ts +2 -1
  15. package/dist/components/screen-cast-dialog.d.ts.map +1 -1
  16. package/dist/components/shared-styles.d.ts +5 -0
  17. package/dist/components/shared-styles.d.ts.map +1 -0
  18. package/dist/components/source-pills.d.ts.map +1 -1
  19. package/dist/components/success-card.d.ts +3 -1
  20. package/dist/components/success-card.d.ts.map +1 -1
  21. package/dist/components/url-dialog.d.ts +2 -2
  22. package/dist/components/url-dialog.d.ts.map +1 -1
  23. package/dist/connectors/provider-registry.d.ts.map +1 -1
  24. package/dist/define.cjs +1 -1
  25. package/dist/define.js +1 -1
  26. package/dist/engine/upload-engine.d.ts.map +1 -1
  27. package/dist/events/public-events.d.ts +1 -3
  28. package/dist/events/public-events.d.ts.map +1 -1
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.js +1 -1
  31. package/dist/{provider-browser-C-S_MPrC.js → provider-browser-CUbPlWmj.js} +430 -185
  32. package/dist/provider-browser-D7G2wcFH.cjs +820 -0
  33. package/dist/{search-provider-browser-jCOer2Y9.js → search-provider-browser-D_kyqQ2m.js} +30 -30
  34. package/dist/{search-provider-browser-DxmLznEB.cjs → search-provider-browser-uDZrkDBZ.cjs} +29 -29
  35. package/dist/sfx-uploader-Cxz9YHev.js +5387 -0
  36. package/dist/sfx-uploader-DbaSJxEf.cjs +3298 -0
  37. package/dist/sfx-uploader.d.ts +55 -1
  38. package/dist/sfx-uploader.d.ts.map +1 -1
  39. package/dist/store/store.types.d.ts +1 -1
  40. package/dist/store/store.types.d.ts.map +1 -1
  41. package/dist/types/source.types.d.ts +3 -0
  42. package/dist/types/source.types.d.ts.map +1 -1
  43. package/dist/utils/file-utils.d.ts +2 -0
  44. package/dist/utils/file-utils.d.ts.map +1 -1
  45. package/dist/utils/focus-trap.d.ts +7 -0
  46. package/dist/utils/focus-trap.d.ts.map +1 -0
  47. package/dist/utils/validate.d.ts +11 -0
  48. package/dist/utils/validate.d.ts.map +1 -1
  49. package/package.json +3 -2
  50. package/dist/events/event-bus.d.ts +0 -38
  51. package/dist/events/event-bus.d.ts.map +0 -1
  52. package/dist/provider-browser-CmCwv0ph.cjs +0 -581
  53. package/dist/sfx-uploader-BVDK-9xi.cjs +0 -2029
  54. package/dist/sfx-uploader-C2lWIRnU.js +0 -3789
@@ -0,0 +1,3298 @@
1
+ "use strict";const n=require("lit"),p=require("lit/decorators.js"),U=require("lit/directives/unsafe-svg.js"),O=require("lit/directives/unsafe-html.js");class we{constructor(e){this.listeners=new Set,this._notifying=!1,this._pendingState=null,this.state=e}getState(){return this.state}setState(e){if(this._notifying){this._pendingState={...this._pendingState||{},...e};return}const t=this.state;this.state={...t,...e},this._notifying=!0;try{this.listeners.forEach(r=>r(this.state,t))}finally{this._notifying=!1}if(this._pendingState){const r=this._pendingState;this._pendingState=null,this.setState(r)}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}destroy(){this.listeners.clear()}}function k(a,e,t){const r=a.getState().files,i=r.get(e);if(!i)return;const s=new Map(r);s.set(e,{...i,...t}),a.setState({files:s})}function L(a,e){const t=new Map(a.getState().files);t.set(e.id,e),a.setState({files:t})}function ge(a,e){const t=a.getState().files;if(!t.has(e))return;const r=new Map(t);r.delete(e),a.setState({files:r})}function _e(){return new we({files:new Map,queueConfig:{concurrency:3,autoProceed:!1,retryConfig:{maxRetries:0,baseDelay:1e3,maxDelay:3e4,backoffFactor:2}},isPaused:!1,restrictions:{maxFileSize:null,maxTotalFilesSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,blockedFileTypes:null},targetFolder:"/",totalProgress:0,totalSpeed:0,totalBytesUploaded:0,totalBytes:0,isUploading:!1})}class Ee{constructor(e,t){this.host=e,this.store=t,e.addController(this)}get state(){return this.store.getState()}setState(e){this.store.setState(e)}hostConnected(){this.unsubscribe=this.store.subscribe(()=>{this.host.requestUpdate()})}hostDisconnected(){var e;(e=this.unsubscribe)==null||e.call(this)}}function Ue(a,e){const t=new XMLHttpRequest;let r=!1;const s=`${e.apiBase.replace(/\/+$/,"")}/v4/files?folder=${encodeURIComponent(e.folder)}`;t.open("POST",s);for(const[l,c]of Object.entries(e.authHeaders))t.setRequestHeader(l,c);t.upload.addEventListener("progress",l=>{l.lengthComputable&&!r&&e.onProgress(l.loaded,l.total)}),t.addEventListener("load",()=>{if(r)return;let l;try{l=JSON.parse(t.responseText)}catch{e.onError(new Error(`Invalid JSON response (HTTP ${t.status})`));return}t.status>=200&&t.status<300&&l.status==="success"?e.onComplete(l):e.onError(new Error(l.msg||`Upload failed (HTTP ${t.status})`))}),t.addEventListener("error",()=>{r||e.onError(new Error("Network error — check your connection"))}),t.addEventListener("timeout",()=>{r||e.onError(new Error("Upload timed out"))});const o=new FormData;if(a.file){const l={name:a.name,type:a.type};Object.keys(a.meta).length>0&&(l.meta=a.meta),a.tags.length>0&&(l.tags=a.tags),o.append("info[files[]]",JSON.stringify(l)),o.append("files[]",a.file,a.name)}return t.timeout=6e4,t.send(o),{abort(){r=!0,t.abort()}}}function Pe(a,e){const t=new XMLHttpRequest;let r=!1;const s=`${e.apiBase.replace(/\/+$/,"")}/v4/files/upload_url`;t.open("POST",s);for(const[l,c]of Object.entries(e.authHeaders))t.setRequestHeader(l,c);if(t.setRequestHeader("Content-Type","application/json"),t.addEventListener("load",()=>{if(r)return;let l;try{l=JSON.parse(t.responseText)}catch{e.onError(new Error(`Invalid JSON response (HTTP ${t.status})`));return}t.status>=200&&t.status<300&&l.status==="success"?e.onComplete(l):e.onError(new Error(l.msg||`Upload failed (HTTP ${t.status})`))}),t.addEventListener("error",()=>{r||e.onError(new Error("Network error — check your connection"))}),t.addEventListener("timeout",()=>{r||e.onError(new Error("Upload timed out"))}),!a.remoteUrl)return e.onError(new Error("Remote URL is required for URL upload")),{abort(){}};const o={files_urls:[{url:a.remoteUrl,name:a.name}],dir:e.folder};return t.timeout=6e4,t.send(JSON.stringify(o)),{abort(){r=!0,t.abort()}}}function G(a){return{Accept:"application/json","Content-Type":"application/json","uppy-auth-token":a}}function A(a){return a.replace(/\/+$/,"")}const De={"google-drive":"drive",dropbox:"dropbox",onedrive:"onedrive",box:"box",instagram:"instagram",facebook:"facebook",unsplash:"unsplash"};function B(a){return De[a]??a}function ze(a,e){const t=A(a),r=btoa(JSON.stringify({origin:window.location.origin})),i=B(e);return`${t}/${i}/connect?state=${encodeURIComponent(r)}`}async function Fe(a,e,t,r=""){const i=A(a),s=r?`/${r}`:"",o=B(e),l=await fetch(`${i}/${o}/list${s}`,{method:"GET",headers:G(t),credentials:"same-origin"});if(l.status===401)throw new J;if(!l.ok){const c=await l.json().catch(()=>null);throw new Error((c==null?void 0:c.message)||`Companion list failed (HTTP ${l.status})`)}return l.json()}async function Te(a,e,t){const r=A(a),i=await fetch(`${r}/${t}`,{method:"GET",headers:G(e),credentials:"same-origin"});if(i.status===401)throw new J;if(!i.ok){const s=await i.json().catch(()=>null);throw new Error((s==null?void 0:s.message)||`Companion list failed (HTTP ${i.status})`)}return i.json()}async function Le(a,e,t,r){const i=A(a),s=B(e),o=r?`q=${encodeURIComponent(t)}&${r}`:`q=${encodeURIComponent(t)}`,l=await fetch(`${i}/search/${s}/list?${o}`,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"},credentials:"same-origin"});if(!l.ok){const c=await l.json().catch(()=>null);throw new Error((c==null?void 0:c.message)||`Search failed (HTTP ${l.status})`)}return l.json()}async function Re(a,e,t,r,i,s=!1){const o=A(a),l=B(e),c=s?`${o}/search/${l}/get/${r}`:`${o}/${l}/get/${r}`,d=s?{Accept:"application/json","Content-Type":"application/json"}:G(t),u=await fetch(c,{method:"POST",headers:d,credentials:"same-origin",body:JSON.stringify({...i,httpMethod:i.httpMethod??"POST",useFormData:i.useFormData??!0,fieldname:i.fieldname??"files[]"})});if(u.status===401)throw new J;if(!u.ok){const f=await u.json().catch(()=>null);throw new Error((f==null?void 0:f.message)||`Companion upload failed (HTTP ${u.status})`)}return u.json()}async function Oe(a,e,t){const r=A(a),i=B(e),s=await fetch(`${r}/${i}/logout`,{method:"GET",headers:G(t),credentials:"same-origin"});return s.ok?s.json():{ok:!1,revoked:!1}}function Me(a){var i;const t=((i=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(a))==null?void 0:i[1])??a;return`${location.protocol==="https:"?"wss":"ws"}://${t}`}class J extends Error{constructor(){super("Authentication expired"),this.name="AuthExpiredError"}}function je(a,e){const t=a.remoteInfo;if(!t)return e.onError(new Error("remoteInfo is required for companion upload")),{abort(){}};let r=!1,i=null;const o=`${e.apiBase.replace(/\/+$/,"")}/v4/files?folder=${encodeURIComponent(e.folder)}`,l={};a.meta&&Object.keys(a.meta).length>0&&Object.assign(l,a.meta),a.tags&&a.tags.length>0&&(l.tags=a.tags);const c=!t.token;return Re(t.companionUrl,t.provider,t.token,t.requestPath,{fileId:t.fileId,endpoint:o,headers:e.authHeaders,size:t.size,metadata:Object.keys(l).length>0?l:void 0},c).then(d=>{if(r)return;const f=`${Me(t.companionUrl)}/api/${d.token}`;try{i=new WebSocket(f)}catch{e.onError(new Error("Failed to connect to upload progress channel"));return}i.onmessage=h=>{var g,m,v;if(!r)try{const T=JSON.parse(h.data);switch(T.action){case"progress":{const y=T.payload,E=y.bytesUploaded??0,I=y.bytesTotal??(t.size||1);e.onProgress(E,I);break}case"success":{const y=T.payload;if(i==null||i.close(),(g=y.response)!=null&&g.responseText)try{const E=JSON.parse(y.response.responseText);if(E.status==="success"){e.onComplete(E);return}e.onError(new Error(E.msg||"Upload failed"));return}catch{}e.onError(new Error("Upload completed but no valid response received"));break}case"error":{i==null||i.close();const y=T.payload;let E=((m=y.error)==null?void 0:m.message)||"Upload failed";if((v=y.response)!=null&&v.responseText)try{const I=JSON.parse(y.response.responseText);E=I.hint||I.msg||I.message||E}catch{}e.onError(new Error(E));break}}}catch{}},i.onerror=()=>{r||e.onError(new Error("Upload progress connection failed"))},i.onclose=()=>{i=null}}).catch(d=>{r||e.onError(d instanceof Error?d:new Error(String(d)))}),{abort(){if(r=!0,i){try{i.send(JSON.stringify({action:"cancel",payload:{}}))}catch{}i.close(),i=null}}}}class ke{constructor(e,t){this.activeUploads=new Map,this.retryTimers=new Map,this.unsubscribe=null,this.store=e,this.config=t}start(){this.unsubscribe||(this.unsubscribe=this.store.subscribe(()=>this.processQueue()),this.processQueue())}uploadAll(){const{files:e}=this.store.getState();let t=!1;for(const r of e.values())r.status==="idle"?(k(this.store,r.id,{status:"queued"}),t=!0):r.status==="queued"&&(t=!0);t&&(this.store.setState({isUploading:!0}),this.processQueue())}retryFile(e){const t=this.store.getState().files.get(e);!t||t.status!=="error"&&t.status!=="failed"||(k(this.store,e,{status:"queued",error:null,progress:0,bytesUploaded:0,speed:0}),this.processQueue())}retryAll(){const{files:e}=this.store.getState();for(const t of e.values())(t.status==="error"||t.status==="failed")&&k(this.store,t.id,{status:"queued",error:null,progress:0,bytesUploaded:0,speed:0});this.processQueue()}cancelFile(e){const t=this.store.getState().files.get(e);!t||!xe(t.status)||(this.abortUpload(e),k(this.store,e,{status:"cancelled"}))}cancelAll(){const{files:e}=this.store.getState();for(const t of e.values())xe(t.status)&&(this.abortUpload(t.id),k(this.store,t.id,{status:"cancelled"}));this.store.setState({isUploading:!1})}updateConfig(e){Object.assign(this.config,e)}destroy(){var e;for(const t of this.activeUploads.keys())this.abortUpload(t);for(const t of this.retryTimers.values())clearTimeout(t);this.retryTimers.clear(),(e=this.unsubscribe)==null||e.call(this),this.unsubscribe=null}processQueue(){const e=this.store.getState();if(e.isPaused)return;const{concurrency:t}=e.queueConfig,r=this.activeUploads.size,i=t-r;if(i<=0)return;const o=[...e.files.values()].filter(l=>l.status==="queued").sort((l,c)=>l.retryCount!==c.retryCount?c.retryCount-l.retryCount:l.addedAt-c.addedAt).slice(0,i);for(const l of o)this.startUpload(l)}startUpload(e){k(this.store,e.id,{status:"uploading",error:null});let t=0,r=Date.now(),i=0;const s={apiBase:this.config.apiBase,authHeaders:this.config.authHeaders,folder:this.store.getState().targetFolder,onComplete:c=>this.handleComplete(e.id,c),onError:c=>this.handleError(e.id,c)},o=(c,d)=>{const u=Date.now(),f=(u-r)/1e3;if(f>0){const g=(c-t)/f;i=i===0?g:.3*g+.7*i}t=c,r=u;const h=d>0?c/d*100:0;k(this.store,e.id,{progress:h,bytesUploaded:c,speed:i}),this.updateTotalProgress()};let l;e.remoteInfo?l=je(e,{...s,onProgress:o}):e.remoteUrl?l=Pe(e,s):l=Ue(e,{...s,onProgress:o}),this.activeUploads.set(e.id,l)}handleComplete(e,t){this.activeUploads.delete(e),k(this.store,e,{status:"complete",progress:100,response:t}),this.updateTotalProgress(),this.checkAllComplete(),this.processQueue()}handleError(e,t){this.activeUploads.delete(e);const r=this.store.getState().files.get(e);if(!r)return;const{retryConfig:i}=this.store.getState().queueConfig,s=r.retryCount+1;if(s<=i.maxRetries){const o=Math.min(i.baseDelay*Math.pow(i.backoffFactor,r.retryCount),i.maxDelay);k(this.store,e,{status:"retrying",error:t.message,retryCount:s});const l=setTimeout(()=>{this.retryTimers.delete(e),k(this.store,e,{status:"queued"}),this.processQueue()},o);this.retryTimers.set(e,l)}else k(this.store,e,{status:"failed",error:t.message}),this.checkAllComplete(),this.processQueue()}abortUpload(e){var r;(r=this.activeUploads.get(e))==null||r.abort(),this.activeUploads.delete(e);const t=this.retryTimers.get(e);t&&(clearTimeout(t),this.retryTimers.delete(e))}updateTotalProgress(){const{files:e}=this.store.getState();let t=0,r=0,i=0;for(const s of e.values())(s.status==="queued"||s.status==="uploading"||s.status==="retrying"||s.status==="complete"||s.status==="failed")&&(t+=s.size,r+=s.status==="complete"?s.size:s.bytesUploaded),s.status==="uploading"&&(i+=s.speed);this.store.setState({totalBytes:t,totalBytesUploaded:r,totalSpeed:i,totalProgress:t>0?r/t*100:0})}checkAllComplete(){const{files:e}=this.store.getState();![...e.values()].some(r=>r.status==="queued"||r.status==="uploading"||r.status==="retrying")&&this.store.getState().isUploading&&this.store.setState({isUploading:!1})}}function xe(a){return a==="queued"||a==="uploading"||a==="retrying"}function Z(a){return`https://api.filerobot.com/${a}`}async function Ce(a,e){const t=`${Z(a)}/key/${encodeURIComponent(e)}`,r=new AbortController,i=setTimeout(()=>r.abort(),3e4);try{const s=await fetch(t,{signal:r.signal});if(clearTimeout(i),!s.ok)throw new Error(`SASS key exchange failed (HTTP ${s.status})`);const o=await s.json();if(o.status==="error")throw new Error(`SASS key exchange failed: ${o.msg||"Unknown error"}`);return o.key}catch(s){throw clearTimeout(i),s instanceof DOMException&&s.name==="AbortError"?new Error("SASS key exchange timed out"):s}}function N(a,e){const t={};switch(a.mode){case"security-template":if(!e)throw new Error("[sfx-uploader] Cannot build auth headers for security-template mode: SASS key exchange has not been performed. Call resolveAuth() first or use sass-key mode with a pre-resolved key.");t["X-Filerobot-Key"]=e;break;case"sass-key":t["X-Filerobot-Key"]=a.sassKey;break;case"session":t["X-Filerobot-Session"]=a.sessionToken,a.companyToken&&(t["X-Company-Token"]=a.companyToken),a.projectToken&&(t["X-Project-Token"]=a.projectToken);break}return a.airboxPuid&&(t["X-Filerobot-Airbox-Puid"]=a.airboxPuid),t}async function $e(a){const e=Z(a.container);if(a.mode==="security-template"){const t=await Ce(a.container,a.securityTemplateId);return{apiBase:e,headers:N(a,t),sassKey:t}}return{apiBase:e,headers:N(a)}}const x={FILE_ADDED:"sfx-file-added",FILE_REMOVED:"sfx-file-removed",FILE_REJECTED:"sfx-file-rejected",UPLOAD_STARTED:"sfx-upload-started",UPLOAD_PROGRESS:"sfx-upload-progress",UPLOAD_COMPLETE:"sfx-upload-complete",UPLOAD_ERROR:"sfx-upload-error",UPLOAD_RETRY:"sfx-upload-retry",ALL_COMPLETE:"sfx-all-complete",TOTAL_PROGRESS:"sfx-total-progress",BEFORE_UPLOAD:"sfx-before-upload",OPEN:"sfx-open",CLOSE:"sfx-close",CANCEL:"sfx-cancel",COMPLETE_ACTION:"sfx-complete-action",FILE_PREVIEW:"sfx-file-preview",FILL_METADATA:"sfx-fill-metadata"};let Ae=0;function R(){return`file-${Date.now()}-${++Ae}`}function V(a){if(a<=0)return"0 B";const e=["B","KB","MB","GB"],t=Math.min(Math.floor(Math.log(a)/Math.log(1024)),e.length-1),r=a/Math.pow(1024,t);return`${t===0?r:r.toFixed(1)} ${e[t]}`}function Ie(a){var t;const e=((t=a.name.split(".").pop())==null?void 0:t.toLowerCase())??"";return a.type.startsWith("image/")?"image":a.type.startsWith("video/")||["mp4","mov","avi","webm","mkv"].includes(e)?"vid":a.type==="application/pdf"||e==="pdf"?"pdf":["doc","docx","xls","xlsx","ppt","pptx","txt","rtf","odt"].includes(e)?"doc":["zip","rar","7z","tar","gz","bz2"].includes(e)?"zip":"gen"}function Be(a){const e=a.lastIndexOf(".");return e>=0?a.slice(e+1).toUpperCase():""}const He={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",bmp:"image/bmp",ico:"image/x-icon",mp4:"video/mp4",mov:"video/quicktime",avi:"video/x-msvideo",webm:"video/webm",pdf:"application/pdf",zip:"application/zip",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};function qe(a){var t;const e=((t=a.split(".").pop())==null?void 0:t.toLowerCase())??"";return He[e]||""}function Ye(a){return new Promise(e=>{const t=document.createElement("video");t.preload="metadata",t.muted=!0,t.playsInline=!0;const r=URL.createObjectURL(a);let i=!1;const s=()=>{i||(i=!0,e(null)),t.removeAttribute("src"),t.load(),URL.revokeObjectURL(r)};t.addEventListener("seeked",()=>{try{const o=document.createElement("canvas");o.width=t.videoWidth||320,o.height=t.videoHeight||240;const l=o.getContext("2d");if(l){l.drawImage(t,0,0,o.width,o.height),o.toBlob(c=>{i||(i=!0,e(c?URL.createObjectURL(c):null),t.removeAttribute("src"),t.load(),URL.revokeObjectURL(r))},"image/jpeg",.7);return}}catch{}s()},{once:!0}),t.addEventListener("error",()=>s(),{once:!0}),setTimeout(()=>s(),5e3),t.src=r,t.addEventListener("loadeddata",()=>{t.currentTime=.1},{once:!0})})}function te(a,e,t){var r,i;if(e.maxFileSize!=null&&a.size>0&&a.size>e.maxFileSize)return`File exceeds ${(e.maxFileSize/1048576).toFixed(1)} MB limit`;if(e.maxTotalFilesSize!=null&&a.size>0){let s=a.size;for(const o of t.values())o.status!=="rejected"&&o.status!=="cancelled"&&(s+=o.size);if(s>e.maxTotalFilesSize)return"Total file size limit exceeded"}if(e.maxNumberOfFiles!=null){let s=0;for(const o of t.values())o.status!=="rejected"&&o.status!=="cancelled"&&s++;if(s>=e.maxNumberOfFiles)return`Maximum ${e.maxNumberOfFiles} files allowed`}if(e.allowedFileTypes!=null){const s=e.allowedFileTypes,o="."+(((r=a.name.split(".").pop())==null?void 0:r.toLowerCase())??"");if(!s.some(c=>c.startsWith(".")?o===c.toLowerCase():c.endsWith("/*")?a.type.startsWith(c.slice(0,-1)):a.type===c))return"File type not allowed"}if(e.blockedFileTypes!=null){const s=e.blockedFileTypes,o="."+(((i=a.name.split(".").pop())==null?void 0:i.toLowerCase())??"");if(s.some(c=>c.startsWith(".")?o===c.toLowerCase():c.endsWith("/*")?a.type.startsWith(c.slice(0,-1)):a.type===c))return"File type is blocked"}return null}function Ne(a,e,t){return te(a,e,t)}function Ve(a){return a.allowedFileTypes?a.allowedFileTypes.join(","):""}const ve={"google-drive":{id:"google-drive",label:"Google Drive",fillIcon:!0,icon:"",brandHtml:'<span class="brand-ico" style="background:transparent"><svg width="16" height="16" viewBox="0 0 87.3 78"><path d="M6.6 66.85l3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3L27.5 53H0c0 1.55.4 3.1 1.2 4.5z" fill="#0066da"/><path d="M43.65 25L29.9 1.2C28.55 2 27.4 3.1 26.6 4.5L1.2 48.5C.4 49.9 0 51.45 0 53h27.5z" fill="#00ac47"/><path d="M73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5H59.8l5.65 10.85z" fill="#ea4335"/><path d="M43.65 25L57.4 1.2C56.05.4 54.5 0 52.9 0H34.4c-1.6 0-3.15.45-4.5 1.2z" fill="#00832d"/><path d="M59.8 53H27.5L13.75 76.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z" fill="#2684fc"/><path d="M73.4 26.5l-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3L43.65 25 59.8 53h27.45c0-1.55-.4-3.1-1.2-4.5z" fill="#ffba00"/></svg></span>'},dropbox:{id:"dropbox",label:"Dropbox",fillIcon:!0,icon:"",brandHtml:'<span class="brand-ico" style="background:#0061ff"><svg width="11" height="11" viewBox="0 0 528 512" fill="white"><path d="M264.4 116.3l-132 84.3 132 84.3-132 84.3L0 284.1l132.3-84.3L0 116.3 132.3 32l132.1 84.3zm-132 284.5l132-84.3 132 84.3-132 84.4-132-84.4zm132-116.6l132.3-84.3-132.3-83.9 131.6-84.3L528 116.3l-132.3 84.1L528 284.7l-132.4 83.9-131.2-84.4z"/></svg></span>'},onedrive:{id:"onedrive",label:"OneDrive",fillIcon:!0,icon:"",brandHtml:'<span class="brand-ico" style="background:#0078d4"><svg width="11" height="11" viewBox="0 0 24 24" fill="white"><path d="M10.5 13.5C10.5 11.57 12.07 10 14 10h6.5c.17 0 .34.01.5.02A6 6 0 009.01 11.6 4 4 0 0010.5 13.5zM12 14.5a5 5 0 00-5-5 5 5 0 00-5 5 3 3 0 003 3h9.5A3.5 3.5 0 0018 14c0-.18-.01-.35-.03-.52A5.48 5.48 0 0112 14.5z"/></svg></span>'},box:{id:"box",label:"Box",fillIcon:!0,icon:"",brandHtml:'<span class="brand-ico" style="background:#0e50a0;font-size:9px;font-weight:800;color:#fff">box</span>'},instagram:{id:"instagram",label:"Instagram",fillIcon:!0,icon:"",brandHtml:'<span class="brand-ico" style="background:linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888)"><svg width="12" height="12" viewBox="0 0 24 24" fill="white"><path d="M12 2.16c2.94 0 3.29.01 4.45.06 1.07.05 1.8.22 2.43.46.66.25 1.21.6 1.77 1.16.55.55.9 1.1 1.16 1.77.25.64.41 1.37.46 2.43.05 1.16.06 1.51.06 4.45s-.01 3.29-.06 4.45c-.05 1.07-.22 1.8-.46 2.43a4.9 4.9 0 01-1.16 1.77c-.55.55-1.1.9-1.77 1.16-.64.25-1.37.41-2.43.46-1.16.05-1.51.06-4.45.06s-3.29-.01-4.45-.06c-1.07-.05-1.8-.22-2.43-.46a4.9 4.9 0 01-1.77-1.16 4.9 4.9 0 01-1.16-1.77c-.25-.64-.41-1.37-.46-2.43C2.17 15.29 2.16 14.94 2.16 12s.01-3.29.06-4.45c.05-1.07.22-1.8.46-2.43a4.9 4.9 0 011.16-1.77A4.9 4.9 0 015.61 2.2c.64-.25 1.37-.41 2.43-.46C9.21 2.17 9.56 2.16 12 2.16zM12 16a4 4 0 110-8 4 4 0 010 8zm6.4-9.85a1.44 1.44 0 100 2.88 1.44 1.44 0 000-2.88z"/></svg></span>'},facebook:{id:"facebook",label:"Facebook",fillIcon:!0,icon:"",brandHtml:'<span class="brand-ico" style="background:#1877f2"><svg width="12" height="12" viewBox="0 0 24 24" fill="white"><path d="M24 12.07C24 5.41 18.63 0 12 0S0 5.41 0 12.07c0 6.02 4.39 11.02 10.12 11.93v-8.44H7.08v-3.49h3.04V9.41c0-3.02 1.79-4.69 4.53-4.69 1.31 0 2.68.24 2.68.24v2.97h-1.51c-1.49 0-1.95.93-1.95 1.89v2.26h3.33l-.53 3.49h-2.8v8.44C19.61 23.09 24 18.09 24 12.07z"/></svg></span>'},unsplash:{id:"unsplash",label:"Unsplash",fillIcon:!0,icon:"",brandHtml:'<span class="brand-ico" style="background:#111"><svg width="12" height="12" viewBox="0 0 24 24" fill="white"><path d="M8.5 11.5v5h7v-5h5.5V21h-18v-9.5h5.5zm7-8v5h-7v-5h7z"/></svg></span>'}};function Se(a){return a.filter(e=>e in ve).map(e=>ve[e])}var Xe=Object.defineProperty,We=(a,e,t,r)=>{for(var i=void 0,s=a.length-1,o;s>=0;s--)(o=a[s])&&(i=o(e,t,i)||i);return i&&Xe(e,t,i),i};const Ke='<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>',Ge='<path d="M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71"/>',Je='<path d="M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z"/><circle cx="12" cy="13" r="4"/>',Ze='<rect x="2" y="3" width="20" height="14" rx="2"/><circle cx="12" cy="10" r="1"/><path d="M7 21l5-5 5 5"/>',M=[{id:"device",label:"My Device",icon:Ke,iconColor:"#2563eb"},{id:"url",label:"URL link",icon:Ge,iconColor:"#16a34a"},{id:"camera",label:"Camera",icon:Je,iconColor:"#7c3aed"},{id:"screen-cast",label:"Screen capture",icon:Ze,iconColor:"#ea580c"}],oe=class oe extends n.LitElement{constructor(){super(...arguments),this.sources=M}_handleClick(e){this.dispatchEvent(new CustomEvent("source-click",{detail:{source:e.id},bubbles:!0,composed:!0}))}render(){return n.html`
2
+ ${this.sources.map(e=>n.html`
3
+ <button @click=${()=>this._handleClick(e)}>
4
+ ${e.brandHtml?O.unsafeHTML(e.brandHtml):n.svg`<svg viewBox="0 0 24 24" class=${e.fillIcon?"fill-icon":""}>${U.unsafeSVG(e.icon)}</svg>`}
5
+ ${e.label}
6
+ </button>
7
+ `)}
8
+ `}};oe.styles=n.css`
9
+ :host {
10
+ display: flex;
11
+ flex-wrap: wrap;
12
+ gap: 8px;
13
+ justify-content: center;
14
+ }
15
+
16
+ button {
17
+ display: inline-flex;
18
+ align-items: center;
19
+ gap: 9px;
20
+ padding: 13px 24px;
21
+ border-radius: 50px;
22
+ border: 1.5px solid var(--sfx-up-border, #e8edf5);
23
+ background: var(--sfx-up-bg, #fff);
24
+ font-size: 14px;
25
+ font-weight: 500;
26
+ color: var(--sfx-up-text-secondary, #475569);
27
+ cursor: pointer;
28
+ transition: all 0.18s ease;
29
+ white-space: nowrap;
30
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
31
+ font-family: inherit;
32
+ }
33
+
34
+ button:hover {
35
+ border-color: var(--sfx-up-primary, #2563eb);
36
+ color: var(--sfx-up-primary, #2563eb);
37
+ background: var(--sfx-up-primary-bg, #eff6ff);
38
+ box-shadow: 0 2px 10px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.18));
39
+ transform: translateY(-1px);
40
+ }
41
+
42
+ button:active {
43
+ transform: translateY(0) scale(0.98);
44
+ }
45
+
46
+ :host > button > svg {
47
+ width: 17px;
48
+ height: 17px;
49
+ flex-shrink: 0;
50
+ fill: none;
51
+ stroke: currentColor;
52
+ stroke-width: 2;
53
+ stroke-linecap: round;
54
+ }
55
+
56
+ :host > button > svg.fill-icon {
57
+ fill: currentColor;
58
+ stroke: none;
59
+ stroke-width: 0;
60
+ }
61
+
62
+ .brand-ico {
63
+ width: 20px;
64
+ height: 20px;
65
+ border-radius: 5px;
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: center;
69
+ flex-shrink: 0;
70
+ line-height: 1;
71
+ }
72
+
73
+ .brand-ico svg {
74
+ width: auto;
75
+ height: auto;
76
+ fill: white;
77
+ stroke: none;
78
+ stroke-width: 0;
79
+ }
80
+ `;let X=oe;We([p.property({type:Array})],X.prototype,"sources");var Qe=Object.defineProperty,S=(a,e,t,r)=>{for(var i=void 0,s=a.length-1,o;s>=0;s--)(o=a[s])&&(i=o(e,t,i)||i);return i&&Qe(e,t,i),i};const me=3,ae=class ae extends n.LitElement{constructor(){super(...arguments),this.compact=!1,this.externalDragOver=!1,this.accept="",this.sources=[],this.sourcesLayout="pills",this._dragOver=!1,this._moreOpen=!1,this._visiblePills=me,this._dragCounter=0,this._onDragEnter=e=>{e.preventDefault(),this._dragCounter++,this._dragCounter===1&&(this._dragOver=!0)},this._onDragOver=e=>{e.preventDefault()},this._onDragLeave=e=>{e.preventDefault(),this._dragCounter--,this._dragCounter<=0&&(this._dragCounter=0,this._dragOver=!1)},this._onDrop=e=>{var r;e.preventDefault(),e.stopPropagation(),this._dragCounter=0,this._dragOver=!1;const t=Array.from(((r=e.dataTransfer)==null?void 0:r.files)??[]);t.length>0&&this._emitFiles(t)},this._onClick=e=>{const t=this.shadowRoot.querySelector(".drop-zone");if(t&&this._rippleEl){const r=t.getBoundingClientRect();this._rippleEl.style.left=`${e.clientX-r.left}px`,this._rippleEl.style.top=`${e.clientY-r.top}px`,this._rippleEl.classList.remove("go"),this._rippleEl.offsetWidth,this._rippleEl.classList.add("go")}this.browse()},this._onKeyDown=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.browse())},this._onFileChange=e=>{const t=e.target,r=Array.from(t.files??[]);r.length>0&&this._emitFiles(r),t.value=""},this._onPaste=e=>{var i;if(!this.isConnected||this.offsetWidth===0)return;const t=(i=e.clipboardData)==null?void 0:i.items;if(!t)return;const r=[];for(const s of t)if(s.kind==="file"){const o=s.getAsFile();o&&r.push(o)}r.length>0&&(e.preventDefault(),this._emitFiles(r))},this._onDocClick=()=>{this._moreOpen&&(this._moreOpen=!1)},this._onDocKeyDown=e=>{e.key==="Escape"&&this._moreOpen&&(this._moreOpen=!1)},this._resizeTimer=null,this._onScrollOrResize=()=>{this._moreOpen&&this._positionDropdown(),this._resizeTimer&&clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(()=>this._updateVisiblePills(),100)}}browse(){var e;(e=this.fileInput)==null||e.click()}_onSourceIconClick(e){this.dispatchEvent(new CustomEvent("source-click",{detail:{source:e.id},bubbles:!0,composed:!0}))}_emitFiles(e){this.dispatchEvent(new CustomEvent("files-selected",{detail:{files:e},bubbles:!0,composed:!0}))}_toggleMore(e){e.stopPropagation(),this._moreOpen=!this._moreOpen,this._moreOpen&&requestAnimationFrame(()=>this._positionDropdown())}_positionDropdown(){var f,h;const e=(f=this.shadowRoot)==null?void 0:f.querySelector(".more-wrap > button"),t=(h=this.shadowRoot)==null?void 0:h.querySelector(".more-dropdown");if(!e||!t)return;const r=e.getBoundingClientRect(),i=8,s=t.scrollHeight,o=t.offsetWidth,l=r.top,c=window.innerHeight-r.bottom;l>=s+i||l>c?(t.classList.add("above"),t.classList.remove("below"),t.style.top=`${r.top-s-i}px`):(t.classList.add("below"),t.classList.remove("above"),t.style.top=`${r.bottom+i}px`);let u=r.right-o;u=Math.max(8,Math.min(u,window.innerWidth-o-8)),t.style.left=`${u}px`}_onMoreItemClick(e,t){t.stopPropagation(),this._moreOpen=!1,this._onSourceIconClick(e)}_updateVisiblePills(){const e=window.innerWidth;this.sourcesLayout==="cards"?e<=480?this._visiblePills=2:e<=768?this._visiblePills=3:this._visiblePills=5:e<=480?this._visiblePills=1:e<=768?this._visiblePills=2:this._visiblePills=me}connectedCallback(){super.connectedCallback(),document.addEventListener("paste",this._onPaste),document.addEventListener("click",this._onDocClick),document.addEventListener("keydown",this._onDocKeyDown),window.addEventListener("scroll",this._onScrollOrResize,!0),window.addEventListener("resize",this._onScrollOrResize),this._updateVisiblePills()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("paste",this._onPaste),document.removeEventListener("click",this._onDocClick),document.removeEventListener("keydown",this._onDocKeyDown),window.removeEventListener("scroll",this._onScrollOrResize,!0),window.removeEventListener("resize",this._onScrollOrResize),this._resizeTimer&&clearTimeout(this._resizeTimer)}_renderPill(e){return n.html`
81
+ <button
82
+ class="src-pill"
83
+ @click=${t=>{t.stopPropagation(),this._onSourceIconClick(e)}}
84
+ >
85
+ ${e.brandHtml?O.unsafeHTML(e.brandHtml):n.html`<span class="pill-ico" style=${e.iconColor?`color:${e.iconColor}`:""}>
86
+ ${n.svg`<svg viewBox="0 0 24 24" class=${e.fillIcon?"fill-icon":""}>${U.unsafeSVG(e.icon)}</svg>`}
87
+ </span>`}
88
+ ${e.label}
89
+ </button>
90
+ `}_renderCard(e){return n.html`
91
+ <button
92
+ class="src-card"
93
+ aria-label=${e.label}
94
+ @click=${t=>{t.stopPropagation(),this._onSourceIconClick(e)}}
95
+ >
96
+ ${e.brandHtml?n.html`<span class="card-ico">${O.unsafeHTML(e.brandHtml)}</span>`:n.html`<span class="card-ico" style=${e.iconColor?`color:${e.iconColor}`:""}>
97
+ ${n.svg`<svg viewBox="0 0 24 24" class=${e.fillIcon?"fill-icon":""}>${U.unsafeSVG(e.icon)}</svg>`}
98
+ </span>`}
99
+ <span class="card-label">${e.label}</span>
100
+ </button>
101
+ `}_renderMoreCard(e){return n.html`
102
+ <div class="more-wrap ${this._moreOpen?"open":""}">
103
+ <button class="src-card" @click=${t=>this._toggleMore(t)}>
104
+ <span class="card-ico" style="color: var(--sfx-up-text-muted, #94a3b8)">
105
+ <svg viewBox="0 0 24 24" fill="currentColor" stroke="none">
106
+ <circle cx="5" cy="12" r="2.5"/>
107
+ <circle cx="12" cy="12" r="2.5"/>
108
+ <circle cx="19" cy="12" r="2.5"/>
109
+ </svg>
110
+ </span>
111
+ <span class="card-label">More</span>
112
+ </button>
113
+ <div class="more-dropdown">
114
+ ${e.map(t=>n.html`
115
+ <button class="more-item" @click=${r=>this._onMoreItemClick(t,r)}>
116
+ <div class="more-item-ico">
117
+ ${t.brandHtml?O.unsafeHTML(t.brandHtml):t.iconColor?n.html`<svg viewBox="0 0 24 24" style="color:${t.iconColor}">${U.unsafeSVG(t.icon)}</svg>`:n.svg`<svg viewBox="0 0 24 24">${U.unsafeSVG(t.icon)}</svg>`}
118
+ </div>
119
+ ${t.label}
120
+ </button>
121
+ `)}
122
+ </div>
123
+ </div>
124
+ `}_renderMoreDropdown(e){return n.html`
125
+ <div class="more-wrap ${this._moreOpen?"open":""}">
126
+ <button class="more-pill" @click=${t=>this._toggleMore(t)}>
127
+ <svg class="more-dots" viewBox="0 0 24 24"><circle cx="5" cy="12" r="1.5"/><circle cx="12" cy="12" r="1.5"/><circle cx="19" cy="12" r="1.5"/></svg>
128
+ More
129
+ <svg class="more-chevron" viewBox="0 0 24 24"><polyline points="6 9 12 15 18 9"/></svg>
130
+ </button>
131
+ <div class="more-dropdown">
132
+ ${e.map(t=>n.html`
133
+ <button class="more-item" @click=${r=>this._onMoreItemClick(t,r)}>
134
+ <div class="more-item-ico">
135
+ ${t.brandHtml?O.unsafeHTML(t.brandHtml):t.iconColor?n.html`<svg viewBox="0 0 24 24" style="color:${t.iconColor}">${U.unsafeSVG(t.icon)}</svg>`:n.svg`<svg viewBox="0 0 24 24">${U.unsafeSVG(t.icon)}</svg>`}
136
+ </div>
137
+ ${t.label}
138
+ </button>
139
+ `)}
140
+ </div>
141
+ </div>
142
+ `}render(){const e=["drop-zone",this._dragOver||this.externalDragOver?"drag-over":"",this.compact?"compact":""].filter(Boolean).join(" "),t=this.sources.slice(0,this._visiblePills),r=this.sources.slice(this._visiblePills);return n.html`
143
+ <div
144
+ class=${e}
145
+ role="button"
146
+ tabindex="0"
147
+ aria-label="Drop files here or click to browse"
148
+ @dragenter=${this._onDragEnter}
149
+ @dragover=${this._onDragOver}
150
+ @dragleave=${this._onDragLeave}
151
+ @drop=${this._onDrop}
152
+ @click=${this._onClick}
153
+ @keydown=${this._onKeyDown}
154
+ >
155
+ <div class="dz-glow"></div>
156
+ <div class="rings">
157
+ <div class="ring"></div>
158
+ <div class="ring"></div>
159
+ <div class="core">
160
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round">
161
+ <polyline points="16 16 12 12 8 16" />
162
+ <line x1="12" y1="12" x2="12" y2="21" />
163
+ <path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3" />
164
+ </svg>
165
+ </div>
166
+ </div>
167
+
168
+ <div class="title">
169
+ Drag & Drop or click to <span>browse</span>
170
+ </div>
171
+ ${this.compact?n.nothing:n.html`<div class="subtitle">Drop files anywhere on this page</div>`}
172
+
173
+ ${!this.compact&&this.sources.length>0?n.html`
174
+ <div class="import-divider"><span>Or import from</span></div>
175
+ ${this.sourcesLayout==="cards"?n.html`
176
+ <div class="sources-cards">
177
+ ${t.map(i=>this._renderCard(i))}
178
+ ${r.length>0?this._renderMoreCard(r):n.nothing}
179
+ </div>
180
+ `:n.html`
181
+ <div class="sources-grid">
182
+ ${t.map(i=>this._renderPill(i))}
183
+ ${r.length>0?this._renderMoreDropdown(r):n.nothing}
184
+ </div>
185
+ `}
186
+ `:n.nothing}
187
+
188
+ ${this.compact&&this.sources.length>0?n.html`
189
+ <div class="sources-row">
190
+ <span class="src-divider"></span>
191
+ ${this.sources.map(i=>n.html`
192
+ <button
193
+ class="src-ico"
194
+ style=${i.iconColor&&!i.brandHtml?`color:${i.iconColor}`:""}
195
+ data-tip=${i.label}
196
+ aria-label=${i.label}
197
+ @click=${s=>{s.stopPropagation(),this._onSourceIconClick(i)}}
198
+ >
199
+ ${i.brandHtml?O.unsafeHTML(i.brandHtml):n.svg`<svg viewBox="0 0 24 24" class=${i.fillIcon?"fill-icon":""}>${U.unsafeSVG(i.icon)}</svg>`}
200
+ </button>
201
+ `)}
202
+ </div>
203
+ `:n.nothing}
204
+
205
+ <div class="ripple"></div>
206
+ <input
207
+ type="file"
208
+ multiple
209
+ accept=${this.accept||n.nothing}
210
+ @change=${this._onFileChange}
211
+ />
212
+ </div>
213
+ `}};ae.styles=n.css`
214
+ :host {
215
+ display: flex;
216
+ flex-shrink: 0;
217
+ flex: 1;
218
+ min-height: 0;
219
+ }
220
+
221
+ :host([compact]) {
222
+ flex: 0 0 auto;
223
+ }
224
+
225
+ .drop-zone {
226
+ border: none;
227
+ border-radius: 12px;
228
+ background: var(--sfx-up-bg, #fff);
229
+ padding: 50px 40px 50px;
230
+ display: flex;
231
+ flex-direction: column;
232
+ align-items: center;
233
+ justify-content: center;
234
+ text-align: center;
235
+ cursor: pointer;
236
+ position: relative;
237
+ overflow: visible;
238
+ transition: background 0.22s;
239
+ user-select: none;
240
+ flex: 1;
241
+ }
242
+
243
+ .drop-zone:hover {
244
+ background: transparent;
245
+ }
246
+
247
+ /* Drag over state */
248
+ .drop-zone.drag-over {
249
+ background: var(--sfx-up-primary-bg, #eff6ff);
250
+ }
251
+
252
+ .drag-over .ring {
253
+ border-color: var(--sfx-up-primary, #2563eb);
254
+ animation-duration: 3s;
255
+ }
256
+
257
+ .drag-over .ring:nth-child(2) {
258
+ border-color: var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.4));
259
+ animation-duration: 2s;
260
+ }
261
+
262
+ .drag-over .core {
263
+ background: var(--sfx-up-primary, #2563eb);
264
+ color: var(--sfx-up-bg, #fff);
265
+ transform: scale(1.12);
266
+ box-shadow: 0 8px 24px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.38));
267
+ }
268
+
269
+ /* Compact state when files exist */
270
+ .drop-zone.compact {
271
+ padding: 14px 0;
272
+ flex-direction: row;
273
+ align-items: center;
274
+ gap: 12px;
275
+ justify-content: flex-start;
276
+ overflow: visible;
277
+ border-bottom: 1px solid var(--sfx-up-border, #e2e8f0);
278
+ border-radius: 0;
279
+ animation: compactIn 0.3s ease both;
280
+ }
281
+
282
+ @keyframes compactIn {
283
+ from {
284
+ opacity: 0;
285
+ transform: translateY(-8px);
286
+ }
287
+ to {
288
+ opacity: 1;
289
+ transform: translateY(0);
290
+ }
291
+ }
292
+
293
+ /* --- Radial glow --- */
294
+ .dz-glow {
295
+ position: absolute;
296
+ width: 260px;
297
+ height: 260px;
298
+ top: 20px;
299
+ left: 50%;
300
+ transform: translateX(-50%);
301
+ background: radial-gradient(circle at center, rgba(37, 99, 235, 0.04) 0%, rgba(37, 99, 235, 0.02) 40%, transparent 70%);
302
+ border-radius: 50%;
303
+ pointer-events: none;
304
+ z-index: 0;
305
+ }
306
+
307
+ .compact .dz-glow {
308
+ display: none;
309
+ }
310
+
311
+ /* --- Rings --- */
312
+ .rings {
313
+ width: 120px;
314
+ height: 120px;
315
+ position: relative;
316
+ display: flex;
317
+ align-items: center;
318
+ justify-content: center;
319
+ margin-bottom: 24px;
320
+ flex-shrink: 0;
321
+ }
322
+
323
+ .ring {
324
+ position: absolute;
325
+ inset: 0;
326
+ border-radius: 50%;
327
+ border: 1.5px dashed var(--sfx-up-border, #e2e8f0);
328
+ animation: slowSpin 20s linear infinite;
329
+ transition: border-color 0.3s;
330
+ }
331
+
332
+ .ring:nth-child(2) {
333
+ inset: 13px;
334
+ border-color: var(--sfx-up-border-light, #f1f5f9);
335
+ border-style: dotted;
336
+ animation-direction: reverse;
337
+ animation-duration: 14s;
338
+ }
339
+
340
+ .compact .rings {
341
+ display: none;
342
+ }
343
+
344
+ /* --- Core icon --- */
345
+ .core {
346
+ width: 58px;
347
+ height: 58px;
348
+ border-radius: 50%;
349
+ background: var(--sfx-up-primary-bg, #eff6ff);
350
+ color: var(--sfx-up-primary, #2563eb);
351
+ display: flex;
352
+ align-items: center;
353
+ justify-content: center;
354
+ z-index: 1;
355
+ transition: all 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
356
+ box-shadow: 0 3px 12px rgba(37, 99, 235, 0.15);
357
+ }
358
+
359
+ .core svg {
360
+ width: 26px;
361
+ height: 26px;
362
+ }
363
+
364
+ .drop-zone:hover .core {
365
+ transform: translateY(-2px);
366
+ box-shadow: 0 5px 18px rgba(37, 99, 235, 0.22);
367
+ }
368
+
369
+ /* --- Text --- */
370
+ .title {
371
+ font-size: 20px;
372
+ font-weight: 700;
373
+ color: var(--sfx-up-text, #1e293b);
374
+ margin-bottom: 6px;
375
+ transition: font-size 0.3s, margin 0.3s;
376
+ }
377
+
378
+ .title span {
379
+ color: var(--sfx-up-primary, #2563eb);
380
+ cursor: pointer;
381
+ }
382
+
383
+ .subtitle {
384
+ font-size: 14px;
385
+ color: var(--sfx-up-text-muted, #94a3b8);
386
+ transition: opacity 0.15s;
387
+ margin-bottom: 24px;
388
+ }
389
+
390
+ .compact .title {
391
+ font-size: 14px;
392
+ font-weight: 600;
393
+ margin-bottom: 0;
394
+ white-space: nowrap;
395
+ overflow: hidden;
396
+ text-overflow: ellipsis;
397
+ }
398
+
399
+ .compact .subtitle {
400
+ display: none;
401
+ }
402
+
403
+ /* --- "or Import From" divider --- */
404
+ .import-divider {
405
+ display: flex;
406
+ align-items: center;
407
+ gap: 12px;
408
+ width: 100%;
409
+ max-width: 420px;
410
+ margin-bottom: 20px;
411
+ }
412
+
413
+ .import-divider::before,
414
+ .import-divider::after {
415
+ content: '';
416
+ flex: 1;
417
+ height: 1px;
418
+ background: var(--sfx-up-border, #e2e8f0);
419
+ }
420
+
421
+ .import-divider span {
422
+ font-size: 12px;
423
+ font-weight: 500;
424
+ color: var(--sfx-up-text-muted, #94a3b8);
425
+ white-space: nowrap;
426
+ letter-spacing: 0.3px;
427
+ }
428
+
429
+ .compact .import-divider {
430
+ display: none;
431
+ }
432
+
433
+ /* --- Source pills grid (expanded mode) --- */
434
+ .sources-grid {
435
+ display: flex;
436
+ justify-content: center;
437
+ align-items: center;
438
+ gap: 8px;
439
+ flex-wrap: wrap;
440
+ min-height: 92px;
441
+ }
442
+
443
+ .compact .sources-grid {
444
+ display: none;
445
+ }
446
+
447
+ .src-pill {
448
+ display: inline-flex;
449
+ align-items: center;
450
+ gap: 8px;
451
+ padding: 9px 18px;
452
+ border-radius: 50px;
453
+ border: 1.5px solid rgba(226, 232, 240, 0.6);
454
+ background: rgba(255, 255, 255, 0.7);
455
+ backdrop-filter: blur(8px);
456
+ -webkit-backdrop-filter: blur(8px);
457
+ font-size: 14px;
458
+ font-weight: 500;
459
+ color: var(--sfx-up-text-secondary, #475569);
460
+ cursor: pointer;
461
+ transition: all 0.15s ease;
462
+ white-space: nowrap;
463
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
464
+ font-family: inherit;
465
+ }
466
+
467
+ .src-pill:hover {
468
+ border-color: var(--sfx-up-primary, #2563eb);
469
+ color: var(--sfx-up-primary, #2563eb);
470
+ background: rgba(239, 246, 255, 0.85);
471
+ box-shadow: 0 2px 10px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.18));
472
+ transform: translateY(-1px);
473
+ }
474
+
475
+ .src-pill:active {
476
+ transform: translateY(0) scale(0.98);
477
+ }
478
+
479
+ .src-pill .pill-ico {
480
+ display: flex;
481
+ align-items: center;
482
+ justify-content: center;
483
+ flex-shrink: 0;
484
+ }
485
+
486
+ .src-pill .pill-ico svg {
487
+ width: 16px;
488
+ height: 16px;
489
+ flex-shrink: 0;
490
+ fill: none;
491
+ stroke: currentColor;
492
+ stroke-width: 2;
493
+ stroke-linecap: round;
494
+ }
495
+
496
+ .src-pill .pill-ico svg.fill-icon {
497
+ fill: currentColor;
498
+ stroke: none;
499
+ stroke-width: 0;
500
+ }
501
+
502
+ .src-pill .brand-ico svg {
503
+ width: auto;
504
+ height: auto;
505
+ fill: white;
506
+ stroke: none;
507
+ stroke-width: 0;
508
+ }
509
+
510
+ .src-pill .canva-ico {
511
+ width: 22px;
512
+ height: 22px;
513
+ }
514
+
515
+ .src-pill .canva-ico svg {
516
+ width: 22px;
517
+ height: 22px;
518
+ }
519
+
520
+ /* --- Source cards grid (expanded mode, cards layout) --- */
521
+ .sources-cards {
522
+ display: flex;
523
+ justify-content: center;
524
+ gap: 10px;
525
+ flex-wrap: wrap;
526
+ width: 100%;
527
+ max-width: 700px;
528
+ }
529
+
530
+ .compact .sources-cards {
531
+ display: none;
532
+ }
533
+
534
+ .sources-cards > .more-wrap {
535
+ display: contents;
536
+ }
537
+
538
+ .sources-cards > .more-wrap > .src-card {
539
+ /* restore flex item behaviour lost by display:contents on the wrapper */
540
+ flex: 1;
541
+ min-width: 88px;
542
+ max-width: 130px;
543
+ }
544
+
545
+ .src-card {
546
+ display: flex;
547
+ flex-direction: column;
548
+ align-items: center;
549
+ justify-content: center;
550
+ gap: 10px;
551
+ padding: 20px 12px 16px;
552
+ border-radius: 16px;
553
+ border: 1.5px solid rgba(226, 232, 240, 0.6);
554
+ background: rgba(255, 255, 255, 0.7);
555
+ backdrop-filter: blur(8px);
556
+ -webkit-backdrop-filter: blur(8px);
557
+ cursor: pointer;
558
+ transition: all 0.18s ease;
559
+ flex: 1;
560
+ min-width: 88px;
561
+ max-width: 130px;
562
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
563
+ font-family: inherit;
564
+ }
565
+
566
+ .src-card:hover {
567
+ border-color: var(--sfx-up-primary, #2563eb);
568
+ background: rgba(239, 246, 255, 0.85);
569
+ box-shadow: 0 4px 14px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.18));
570
+ transform: translateY(-2px);
571
+ }
572
+
573
+ .src-card:active {
574
+ transform: translateY(0) scale(0.97);
575
+ }
576
+
577
+ .src-card .card-ico {
578
+ display: flex;
579
+ align-items: center;
580
+ justify-content: center;
581
+ flex-shrink: 0;
582
+ width: 28px;
583
+ height: 28px;
584
+ }
585
+
586
+ .src-card .card-ico svg {
587
+ width: 28px;
588
+ height: 28px;
589
+ fill: none;
590
+ stroke: currentColor;
591
+ stroke-width: 2;
592
+ stroke-linecap: round;
593
+ }
594
+
595
+ .src-card .card-ico svg.fill-icon {
596
+ fill: currentColor;
597
+ stroke: none;
598
+ stroke-width: 0;
599
+ }
600
+
601
+ .src-card .card-label {
602
+ font-size: 12px;
603
+ font-weight: 500;
604
+ color: var(--sfx-up-text-secondary, #475569);
605
+ white-space: nowrap;
606
+ overflow: hidden;
607
+ text-overflow: ellipsis;
608
+ max-width: 100%;
609
+ }
610
+
611
+ .src-card .brand-ico {
612
+ width: 28px;
613
+ height: 28px;
614
+ border-radius: 7px;
615
+ }
616
+
617
+ .src-card .brand-ico svg {
618
+ width: 24px;
619
+ height: 24px;
620
+ fill: white;
621
+ stroke: none;
622
+ stroke-width: 0;
623
+ }
624
+
625
+ /* Google Drive has transparent background — show SVG at full card-ico size */
626
+ .src-card .brand-ico[style*="transparent"] {
627
+ background: none !important;
628
+ width: auto;
629
+ height: auto;
630
+ }
631
+
632
+ .src-card .brand-ico[style*="transparent"] svg {
633
+ width: 28px;
634
+ height: 28px;
635
+ }
636
+
637
+ .src-card .canva-ico {
638
+ width: 32px;
639
+ height: 32px;
640
+ }
641
+
642
+ .src-card .canva-ico svg {
643
+ width: 32px;
644
+ height: 32px;
645
+ }
646
+
647
+ /* --- "More" pill + dropdown --- */
648
+ .more-wrap {
649
+ position: relative;
650
+ }
651
+
652
+ .more-pill {
653
+ display: inline-flex;
654
+ align-items: center;
655
+ gap: 6px;
656
+ padding: 9px 18px;
657
+ border-radius: 50px;
658
+ border: 1.5px solid rgba(226, 232, 240, 0.6);
659
+ background: rgba(255, 255, 255, 0.7);
660
+ backdrop-filter: blur(8px);
661
+ -webkit-backdrop-filter: blur(8px);
662
+ font-size: 14px;
663
+ font-weight: 500;
664
+ color: var(--sfx-up-text-secondary, #475569);
665
+ cursor: pointer;
666
+ transition: all 0.15s ease;
667
+ white-space: nowrap;
668
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
669
+ font-family: inherit;
670
+ }
671
+
672
+ .more-pill:hover,
673
+ .more-wrap.open .more-pill {
674
+ border-color: var(--sfx-up-primary, #2563eb);
675
+ color: var(--sfx-up-primary, #2563eb);
676
+ background: rgba(239, 246, 255, 0.85);
677
+ box-shadow: 0 2px 10px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.18));
678
+ }
679
+
680
+ .more-pill:hover {
681
+ transform: translateY(-1px);
682
+ }
683
+
684
+ .more-pill svg {
685
+ flex-shrink: 0;
686
+ fill: none;
687
+ stroke: currentColor;
688
+ stroke-width: 2.2;
689
+ stroke-linecap: round;
690
+ }
691
+
692
+ .more-dots {
693
+ width: 16px;
694
+ height: 16px;
695
+ color: var(--sfx-up-text-secondary, #475569);
696
+ fill: currentColor;
697
+ stroke: none;
698
+ }
699
+
700
+ .more-wrap.open .more-dots,
701
+ .more-pill:hover .more-dots {
702
+ color: currentColor;
703
+ }
704
+
705
+ .more-chevron {
706
+ width: 12px;
707
+ height: 12px;
708
+ color: var(--sfx-up-text-muted, #94a3b8);
709
+ transition: transform 0.18s ease;
710
+ }
711
+
712
+ .more-wrap.open .more-chevron {
713
+ transform: rotate(180deg);
714
+ color: currentColor;
715
+ }
716
+
717
+ /* Dropdown uses position:fixed to escape overflow:hidden ancestors */
718
+ .more-dropdown {
719
+ position: fixed;
720
+ background: var(--sfx-up-bg, #fff);
721
+ border-radius: 12px;
722
+ box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
723
+ border: 1px solid var(--sfx-up-border, #e8edf5);
724
+ padding: 6px;
725
+ min-width: 210px;
726
+ max-height: 340px;
727
+ overflow-y: auto;
728
+ z-index: 99999;
729
+ opacity: 0;
730
+ visibility: hidden;
731
+ pointer-events: none;
732
+ transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
733
+ }
734
+
735
+ .more-dropdown.above {
736
+ transform: translateY(-6px);
737
+ }
738
+
739
+ .more-dropdown.below {
740
+ transform: translateY(6px);
741
+ }
742
+
743
+ .more-wrap.open .more-dropdown {
744
+ opacity: 1;
745
+ visibility: visible;
746
+ pointer-events: all;
747
+ transform: translateY(0);
748
+ }
749
+
750
+ .more-item {
751
+ display: flex;
752
+ align-items: center;
753
+ gap: 10px;
754
+ padding: 10px 14px;
755
+ border-radius: 6px;
756
+ border: none;
757
+ background: none;
758
+ width: 100%;
759
+ font-size: 13px;
760
+ font-weight: 500;
761
+ color: var(--sfx-up-text, #1e293b);
762
+ cursor: pointer;
763
+ transition: background 0.15s;
764
+ font-family: inherit;
765
+ white-space: nowrap;
766
+ }
767
+
768
+ .more-item:hover {
769
+ background: var(--sfx-up-primary-bg, #f5f7fa);
770
+ }
771
+
772
+ .more-item .more-item-ico {
773
+ width: 32px;
774
+ height: 32px;
775
+ border-radius: 8px;
776
+ background: var(--sfx-up-surface, #f8fafc);
777
+ display: flex;
778
+ align-items: center;
779
+ justify-content: center;
780
+ flex-shrink: 0;
781
+ }
782
+
783
+ .more-item .more-item-ico svg {
784
+ width: 16px;
785
+ height: 16px;
786
+ fill: none;
787
+ stroke: currentColor;
788
+ stroke-width: 2;
789
+ stroke-linecap: round;
790
+ }
791
+
792
+ .more-item .brand-ico {
793
+ width: 20px;
794
+ height: 20px;
795
+ border-radius: 5px;
796
+ display: flex;
797
+ align-items: center;
798
+ justify-content: center;
799
+ flex-shrink: 0;
800
+ }
801
+
802
+ .more-item .brand-ico svg {
803
+ fill: white;
804
+ stroke: none;
805
+ stroke-width: 0;
806
+ }
807
+
808
+ /* --- Brand icon container (for provider logos) --- */
809
+ .brand-ico {
810
+ width: 20px;
811
+ height: 20px;
812
+ border-radius: 5px;
813
+ display: flex;
814
+ align-items: center;
815
+ justify-content: center;
816
+ flex-shrink: 0;
817
+ line-height: 1;
818
+ }
819
+
820
+ .src-ico .brand-ico {
821
+ width: 20px;
822
+ height: 20px;
823
+ border-radius: 5px;
824
+ }
825
+
826
+ .src-ico .brand-ico svg {
827
+ width: 12px;
828
+ height: 12px;
829
+ stroke: none;
830
+ stroke-width: 0;
831
+ }
832
+
833
+ .src-ico .canva-ico,
834
+ .more-item .canva-ico {
835
+ width: 22px;
836
+ height: 22px;
837
+ }
838
+
839
+ .src-ico .canva-ico svg,
840
+ .more-item .canva-ico svg {
841
+ width: 22px;
842
+ height: 22px;
843
+ }
844
+
845
+ /* --- Source icons row (compact mode) --- */
846
+ .sources-row {
847
+ display: none;
848
+ }
849
+
850
+ .compact .sources-row {
851
+ display: flex;
852
+ align-items: center;
853
+ gap: 6px;
854
+ margin-left: auto;
855
+ flex-shrink: 0;
856
+ position: relative;
857
+ z-index: 20;
858
+ }
859
+
860
+ .src-divider {
861
+ width: 1px;
862
+ height: 24px;
863
+ background: var(--sfx-up-border, #e5e7eb);
864
+ margin-right: 4px;
865
+ flex-shrink: 0;
866
+ }
867
+
868
+ .src-ico {
869
+ width: 36px;
870
+ height: 36px;
871
+ border-radius: 8px;
872
+ border: 1.5px solid var(--sfx-up-border, #e2e8f0);
873
+ background: var(--sfx-up-surface, #f8fafc);
874
+ cursor: pointer;
875
+ display: flex;
876
+ align-items: center;
877
+ justify-content: center;
878
+ transition: all 0.15s ease;
879
+ position: relative;
880
+ flex-shrink: 0;
881
+ color: var(--sfx-up-text-muted, #6b7280);
882
+ padding: 0;
883
+ font-family: inherit;
884
+ }
885
+
886
+ .src-ico > svg {
887
+ width: 15px;
888
+ height: 15px;
889
+ fill: none;
890
+ stroke: currentColor;
891
+ stroke-width: 2;
892
+ stroke-linecap: round;
893
+ }
894
+
895
+ .src-ico > svg.fill-icon {
896
+ fill: currentColor;
897
+ stroke: none;
898
+ stroke-width: 0;
899
+ }
900
+
901
+ .src-ico:hover {
902
+ border-color: var(--sfx-up-primary, #2563eb);
903
+ background: var(--sfx-up-primary-bg, #eff6ff);
904
+ transform: translateY(-1px);
905
+ box-shadow: 0 2px 8px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.18));
906
+ color: var(--sfx-up-primary, #2563eb);
907
+ }
908
+
909
+ .src-ico::after {
910
+ content: attr(data-tip);
911
+ position: absolute;
912
+ bottom: -28px;
913
+ left: 50%;
914
+ transform: translateX(-50%);
915
+ background: var(--sfx-up-bg, #fff);
916
+ color: var(--sfx-up-text, #374151);
917
+ font-size: 10px;
918
+ font-weight: 500;
919
+ border: 1px solid var(--sfx-up-border, #e5e7eb);
920
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
921
+ padding: 3px 8px;
922
+ border-radius: 5px;
923
+ white-space: nowrap;
924
+ opacity: 0;
925
+ visibility: hidden;
926
+ transition: opacity 0.15s, visibility 0.15s;
927
+ pointer-events: none;
928
+ z-index: 50;
929
+ font-family: inherit;
930
+ }
931
+
932
+ .src-ico:hover::after {
933
+ opacity: 1;
934
+ visibility: visible;
935
+ }
936
+
937
+ /* --- Ripple --- */
938
+ .ripple {
939
+ position: absolute;
940
+ width: 10px;
941
+ height: 10px;
942
+ border-radius: 50%;
943
+ background: var(--sfx-up-primary, #2563eb);
944
+ opacity: 0;
945
+ pointer-events: none;
946
+ transform: translate(-50%, -50%) scale(0);
947
+ }
948
+
949
+ .ripple.go {
950
+ animation: ripple 0.55s ease-out forwards;
951
+ }
952
+
953
+ /* --- Hidden input --- */
954
+ input[type='file'] {
955
+ display: none;
956
+ }
957
+
958
+ @keyframes slowSpin {
959
+ to {
960
+ transform: rotate(360deg);
961
+ }
962
+ }
963
+
964
+ @keyframes ripple {
965
+ from {
966
+ transform: translate(-50%, -50%) scale(0);
967
+ opacity: 0.18;
968
+ }
969
+ to {
970
+ transform: translate(-50%, -50%) scale(12);
971
+ opacity: 0;
972
+ }
973
+ }
974
+
975
+ .drop-zone:focus-visible,
976
+ .src-pill:focus-visible,
977
+ .src-card:focus-visible,
978
+ .more-pill:focus-visible,
979
+ .src-ico:focus-visible,
980
+ .more-item:focus-visible {
981
+ outline: 2px solid var(--sfx-up-ring, oklch(0.578 0.198 268.129 / 0.7));
982
+ outline-offset: 2px;
983
+ }
984
+
985
+ @media (max-width: 480px) {
986
+ .drop-zone:not(.compact) {
987
+ padding: 32px 20px;
988
+ }
989
+ .title { font-size: 16px; }
990
+ .rings { width: 90px; height: 90px; }
991
+ .core { width: 44px; height: 44px; }
992
+ .core svg { width: 20px; height: 20px; }
993
+ }
994
+
995
+ @media (prefers-reduced-motion: reduce) {
996
+ .ring {
997
+ animation: none;
998
+ }
999
+ .ripple.go {
1000
+ animation: none;
1001
+ }
1002
+ .drop-zone.compact {
1003
+ animation: none;
1004
+ }
1005
+ }
1006
+ `;let b=ae;S([p.property({type:Boolean,reflect:!0})],b.prototype,"compact");S([p.property({type:Boolean,attribute:"external-drag-over"})],b.prototype,"externalDragOver");S([p.property({type:String})],b.prototype,"accept");S([p.property({type:Array})],b.prototype,"sources");S([p.property({type:String,attribute:"sources-layout"})],b.prototype,"sourcesLayout");S([p.state()],b.prototype,"_dragOver");S([p.state()],b.prototype,"_moreOpen");S([p.state()],b.prototype,"_visiblePills");S([p.query(".ripple")],b.prototype,"_rippleEl");S([p.query('input[type="file"]')],b.prototype,"fileInput");const ne=class ne extends n.LitElement{render(){return n.html`
1007
+ <div class="line"></div>
1008
+ <div class="label">or import from</div>
1009
+ <div class="line"></div>
1010
+ `}};ne.styles=n.css`
1011
+ :host {
1012
+ display: flex;
1013
+ align-items: center;
1014
+ gap: 14px;
1015
+ padding: 20px 0;
1016
+ }
1017
+
1018
+ .line {
1019
+ flex: 1;
1020
+ height: 1px;
1021
+ background: var(--sfx-up-border-light, #f1f5f9);
1022
+ }
1023
+
1024
+ .label {
1025
+ font-size: 11px;
1026
+ font-weight: 600;
1027
+ color: var(--sfx-up-text-muted, #cbd5e1);
1028
+ text-transform: uppercase;
1029
+ letter-spacing: 1px;
1030
+ white-space: nowrap;
1031
+ }
1032
+ `;let re=ne;var et=Object.defineProperty,tt=(a,e,t,r)=>{for(var i=void 0,s=a.length-1,o;s>=0;s--)(o=a[s])&&(i=o(e,t,i)||i);return i&&et(e,t,i),i};const le=class le extends n.LitElement{constructor(){super(...arguments),this.files=[]}render(){return n.html`
1033
+ <div class="grid">
1034
+ ${this.files.map((e,t)=>n.html`<sfx-file-item .file=${e} style="--tile-index:${t}"></sfx-file-item>`)}
1035
+ </div>
1036
+ `}};le.styles=n.css`
1037
+ :host {
1038
+ display: block;
1039
+ flex: 1;
1040
+ min-height: 0;
1041
+ overflow-y: auto;
1042
+ padding-bottom: 8px;
1043
+ scrollbar-width: thin;
1044
+ scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
1045
+ }
1046
+
1047
+ :host::-webkit-scrollbar {
1048
+ width: 6px;
1049
+ }
1050
+
1051
+ :host::-webkit-scrollbar-track {
1052
+ background: transparent;
1053
+ margin: 8px 0;
1054
+ }
1055
+
1056
+ :host::-webkit-scrollbar-thumb {
1057
+ background: rgba(0, 0, 0, 0.15);
1058
+ border-radius: 3px;
1059
+ }
1060
+
1061
+ .grid {
1062
+ display: grid;
1063
+ grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
1064
+ gap: 12px;
1065
+ padding: 2px;
1066
+ padding-bottom: 16px;
1067
+ }
1068
+
1069
+ @media (max-width: 480px) {
1070
+ .grid {
1071
+ grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
1072
+ gap: 8px;
1073
+ }
1074
+ }
1075
+ `;let W=le;tt([p.property({attribute:!1})],W.prototype,"files");var rt=Object.defineProperty,it=(a,e,t,r)=>{for(var i=void 0,s=a.length-1,o;s>=0;s--)(o=a[s])&&(i=o(e,t,i)||i);return i&&rt(e,t,i),i};const ce=class ce extends n.LitElement{_remove(){this.dispatchEvent(new CustomEvent("file-remove",{detail:{fileId:this.file.id},bubbles:!0,composed:!0}))}_retry(){this.dispatchEvent(new CustomEvent("file-retry",{detail:{fileId:this.file.id},bubbles:!0,composed:!0}))}_preview(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("file-preview",{detail:{fileId:this.file.id},bubbles:!0,composed:!0}))}render(){const e=this.file;if(!e)return n.nothing;const t=Ie(e),r=e.status==="complete",i=e.status==="uploading",s=e.status==="error"||e.status==="failed",o=e.status==="rejected",l=Be(e.name),c=["tile",r?"done":"",i?"uploading":"",o?"rejected":""].filter(Boolean).join(" ");return n.html`
1076
+ <div class=${c} tabindex="0">
1077
+ <!-- Preview area -->
1078
+ <div class="preview">
1079
+ ${e.previewUrl?n.html`<div class="preview-bg" style="background-image:url(${e.previewUrl})"></div>`:n.html`
1080
+ <div class="preview-bg ${t}"></div>
1081
+ <div class="type-icon">
1082
+ <div class="type-icon-inner ${t}">
1083
+ ${this._renderTypeIcon(t)}
1084
+ ${l?n.html`<div class="ext-label">${l}</div>`:n.nothing}
1085
+ </div>
1086
+ </div>
1087
+ `}
1088
+
1089
+ <!-- Preview button -->
1090
+ ${!r&&!i&&!s&&e.status!=="rejected"?n.html`
1091
+ <button class="preview-btn" @click=${this._preview} aria-label="Preview file">
1092
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
1093
+ <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
1094
+ <circle cx="12" cy="12" r="3"/>
1095
+ </svg>
1096
+ Preview
1097
+ </button>
1098
+ `:n.nothing}
1099
+
1100
+ <!-- Spinner overlay -->
1101
+ <div class="spinner-overlay">
1102
+ <div class="spin-ring"></div>
1103
+ </div>
1104
+
1105
+ <!-- Done badge -->
1106
+ ${r?n.html`<div class="done-badge">
1107
+ <svg viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round">
1108
+ <polyline points="20 6 9 17 4 12" />
1109
+ </svg>
1110
+ </div>`:n.nothing}
1111
+
1112
+ <!-- Progress bar -->
1113
+ ${e.status==="uploading"?n.html`
1114
+ <div class="progress">
1115
+ <div class="progress-fill" style="transform:scaleX(${Math.min(e.progress,100)/100})"></div>
1116
+ </div>
1117
+ `:n.nothing}
1118
+
1119
+ <!-- Error / rejected badge -->
1120
+ ${(s||o)&&e.error?n.html`<div class="error-badge" title=${e.error}>${e.error}</div>`:n.nothing}
1121
+ </div>
1122
+
1123
+ <!-- Action buttons -->
1124
+ <div class="actions">
1125
+ ${s?n.html`
1126
+ <button class="act-btn retry" @click=${this._retry} title="Retry" aria-label="Retry upload">
1127
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
1128
+ <polyline points="23 4 23 10 17 10" />
1129
+ <path d="M20.49 15a9 9 0 11-2.12-9.36L23 10" />
1130
+ </svg>
1131
+ </button>
1132
+ `:n.nothing}
1133
+ <button class="act-btn del" @click=${this._remove} title="Remove" aria-label="Remove file">
1134
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
1135
+ <polyline points="3 6 5 6 21 6" />
1136
+ <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" />
1137
+ <path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
1138
+ <line x1="10" y1="11" x2="10" y2="17" />
1139
+ <line x1="14" y1="11" x2="14" y2="17" />
1140
+ </svg>
1141
+ </button>
1142
+ </div>
1143
+
1144
+ <!-- Info bar -->
1145
+ <div class="info">
1146
+ <div class="name" title=${e.name}>${e.name}</div>
1147
+ <div class="meta">${e.size?V(e.size):""}${e.type?`${e.size?" · ":""}${e.type}`:""}</div>
1148
+ </div>
1149
+ </div>
1150
+ `}_renderTypeIcon(e){switch(e){case"pdf":return n.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>`;case"doc":return n.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>`;case"vid":return n.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><polygon points="23 7 16 12 23 17 23 7"/><rect x="1" y="5" width="15" height="14" rx="2"/></svg>`;case"zip":return n.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M21 8v13H3V8"/><path d="M1 3h22v5H1z"/><path d="M10 12h4"/></svg>`;default:return n.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z"/><polyline points="13 2 13 9 20 9"/></svg>`}}};ce.styles=n.css`
1151
+ :host {
1152
+ display: block;
1153
+ }
1154
+
1155
+ .tile {
1156
+ border-radius: 10px;
1157
+ background: var(--sfx-up-bg, #fff);
1158
+ border: none;
1159
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
1160
+ animation: tileIn 0.45s cubic-bezier(0.34, 1.2, 0.64, 1) both;
1161
+ animation-delay: calc(min(var(--tile-index, 0), 8) * 0.04s);
1162
+ will-change: transform, opacity;
1163
+ transition: box-shadow 0.15s, transform 0.15s;
1164
+ cursor: default;
1165
+ display: flex;
1166
+ flex-direction: column;
1167
+ position: relative;
1168
+ }
1169
+
1170
+ .tile:hover {
1171
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
1172
+ }
1173
+
1174
+ /* --- Preview area --- */
1175
+ .preview {
1176
+ position: relative;
1177
+ aspect-ratio: 16 / 10;
1178
+ overflow: hidden;
1179
+ flex-shrink: 0;
1180
+ background: var(--sfx-up-border-light, #f3f4f6);
1181
+ border-radius: 10px 10px 0 0;
1182
+ }
1183
+
1184
+ .preview-bg {
1185
+ position: absolute;
1186
+ inset: 0;
1187
+ background-size: cover;
1188
+ background-position: center;
1189
+ transition: transform 0.4s ease;
1190
+ }
1191
+
1192
+ .tile:hover .preview-bg {
1193
+ transform: scale(1.03);
1194
+ }
1195
+
1196
+ .preview-bg.pdf { background: linear-gradient(135deg, var(--destructive-10, #fef2f2), var(--destructive-10, #fee2e2)); }
1197
+ .preview-bg.doc { background: linear-gradient(135deg, var(--sfx-up-primary-bg, #eff6ff), var(--sfx-up-primary-bg, #dbeafe)); }
1198
+ .preview-bg.vid { background: linear-gradient(135deg, #f5f3ff, #ede9fe); }
1199
+ .preview-bg.zip { background: linear-gradient(135deg, var(--warning-10, #fffbeb), var(--warning-10, #fef3c7)); }
1200
+ .preview-bg.gen { background: linear-gradient(135deg, var(--sfx-up-border-light, #f8fafc), var(--sfx-up-border-light, #f1f5f9)); }
1201
+
1202
+ /* --- File type icon --- */
1203
+ .type-icon {
1204
+ position: absolute;
1205
+ inset: 0;
1206
+ display: flex;
1207
+ align-items: center;
1208
+ justify-content: center;
1209
+ pointer-events: none;
1210
+ }
1211
+
1212
+ .type-icon-inner {
1213
+ width: 44px;
1214
+ height: 44px;
1215
+ border-radius: 12px;
1216
+ display: flex;
1217
+ align-items: center;
1218
+ justify-content: center;
1219
+ background: rgba(255, 255, 255, 0.9);
1220
+ box-shadow: 0 2px 10px var(--sfx-up-shadow, rgba(0, 0, 0, 0.08));
1221
+ }
1222
+
1223
+ .type-icon-inner svg {
1224
+ width: 22px;
1225
+ height: 22px;
1226
+ }
1227
+
1228
+ .type-icon-inner.pdf { color: var(--sfx-up-error, #dc2626); }
1229
+ .type-icon-inner.doc { color: var(--sfx-up-primary, #1d4ed8); }
1230
+ .type-icon-inner.vid { color: #7c3aed; }
1231
+ .type-icon-inner.zip { color: var(--warning-foreground, #b45309); }
1232
+ .type-icon-inner.gen { color: var(--sfx-up-text-muted, #64748b); }
1233
+
1234
+ .ext-label {
1235
+ font-size: 12px;
1236
+ font-weight: 800;
1237
+ text-transform: uppercase;
1238
+ margin-top: 2px;
1239
+ }
1240
+
1241
+ /* --- Info bar --- */
1242
+ .info {
1243
+ padding: 8px 12px;
1244
+ min-width: 0;
1245
+ }
1246
+
1247
+ .name {
1248
+ font-size: 14px;
1249
+ font-weight: 400;
1250
+ color: var(--foreground, var(--sfx-up-text, #111827));
1251
+ white-space: nowrap;
1252
+ overflow: hidden;
1253
+ text-overflow: ellipsis;
1254
+ margin-bottom: 2px;
1255
+ }
1256
+
1257
+ .meta {
1258
+ font-size: 12px;
1259
+ font-weight: 400;
1260
+ color: var(--sfx-up-text-muted, #9ca3af);
1261
+ white-space: nowrap;
1262
+ overflow: hidden;
1263
+ text-overflow: ellipsis;
1264
+ }
1265
+
1266
+ .tile.done {
1267
+ box-shadow: 0 0 0 2px var(--sfx-up-primary, #2563eb);
1268
+ }
1269
+
1270
+ /* --- Action buttons --- */
1271
+ .actions {
1272
+ position: absolute;
1273
+ top: 6px;
1274
+ right: 6px;
1275
+ display: flex;
1276
+ gap: 4px;
1277
+ opacity: 0;
1278
+ transition: opacity 0.15s;
1279
+ z-index: 10;
1280
+ }
1281
+
1282
+ .tile:hover .actions,
1283
+ .tile:focus-within .actions {
1284
+ opacity: 1;
1285
+ }
1286
+
1287
+ /* Touch devices: always show actions since there is no hover */
1288
+ @media (hover: none) {
1289
+ .actions { opacity: 1; }
1290
+ }
1291
+
1292
+ .act-btn {
1293
+ width: 26px;
1294
+ height: 26px;
1295
+ border-radius: 6px;
1296
+ border: none;
1297
+ background: var(--sfx-up-bg, #fff);
1298
+ box-shadow: 0 1px 4px var(--sfx-up-shadow, rgba(0, 0, 0, 0.15));
1299
+ cursor: pointer;
1300
+ display: flex;
1301
+ align-items: center;
1302
+ justify-content: center;
1303
+ transition: background 0.15s, transform 0.15s;
1304
+ color: var(--sfx-up-text-muted, #9ca3af);
1305
+ padding: 0;
1306
+ }
1307
+
1308
+ .act-btn:hover {
1309
+ background: var(--sfx-up-border-light, #f3f4f6);
1310
+ transform: scale(1.08);
1311
+ }
1312
+
1313
+ .act-btn.del:hover {
1314
+ background: var(--destructive-10, #fee2e2);
1315
+ color: var(--sfx-up-error, #dc2626);
1316
+ }
1317
+
1318
+ .act-btn.retry:hover {
1319
+ background: var(--sfx-up-primary-bg, #eff6ff);
1320
+ color: var(--sfx-up-primary, #2563eb);
1321
+ }
1322
+
1323
+ .act-btn svg {
1324
+ width: 11px;
1325
+ height: 11px;
1326
+ }
1327
+
1328
+ /* --- Preview button --- */
1329
+ .preview-btn {
1330
+ position: absolute;
1331
+ bottom: 50%;
1332
+ left: 50%;
1333
+ transform: translate(-50%, 50%);
1334
+ padding: 6px 16px;
1335
+ border-radius: 6px;
1336
+ border: 1.5px solid var(--sfx-up-primary, #2563eb);
1337
+ background: var(--sfx-up-bg, #fff);
1338
+ cursor: pointer;
1339
+ display: flex;
1340
+ align-items: center;
1341
+ gap: 5px;
1342
+ opacity: 0;
1343
+ transition: all 0.15s ease;
1344
+ color: var(--sfx-up-primary, #2563eb);
1345
+ font-family: inherit;
1346
+ font-size: 11px;
1347
+ font-weight: 600;
1348
+ white-space: nowrap;
1349
+ z-index: 5;
1350
+ }
1351
+
1352
+ .tile:hover .preview-btn,
1353
+ .tile:focus-within .preview-btn {
1354
+ opacity: 1;
1355
+ }
1356
+
1357
+ @media (hover: none) {
1358
+ .preview-btn { opacity: 1; }
1359
+ }
1360
+
1361
+ .preview-btn:hover {
1362
+ background: var(--sfx-up-primary, #2563eb);
1363
+ color: var(--sfx-up-bg, #fff);
1364
+ }
1365
+
1366
+ .preview-btn:hover svg {
1367
+ stroke: var(--sfx-up-bg, #fff);
1368
+ }
1369
+
1370
+ .preview-btn svg {
1371
+ width: 13px;
1372
+ height: 13px;
1373
+ }
1374
+
1375
+ /* --- Progress bar --- */
1376
+ .progress {
1377
+ position: absolute;
1378
+ bottom: 0;
1379
+ left: 0;
1380
+ right: 0;
1381
+ height: 2px;
1382
+ background: rgba(0, 0, 0, 0.06);
1383
+ }
1384
+
1385
+ .progress-fill {
1386
+ height: 100%;
1387
+ background: var(--sfx-up-primary, #2563eb);
1388
+ transform-origin: left;
1389
+ transition: transform 0.32s ease;
1390
+ }
1391
+
1392
+ /* --- Uploading spinner overlay --- */
1393
+ .spinner-overlay {
1394
+ position: absolute;
1395
+ inset: 0;
1396
+ display: flex;
1397
+ align-items: center;
1398
+ justify-content: center;
1399
+ background: rgba(0, 0, 0, 0.22);
1400
+ opacity: 0;
1401
+ transition: opacity 0.2s;
1402
+ pointer-events: none;
1403
+ }
1404
+
1405
+ .tile.uploading .spinner-overlay {
1406
+ opacity: 1;
1407
+ }
1408
+
1409
+ .spin-ring {
1410
+ width: 28px;
1411
+ height: 28px;
1412
+ border: 2.5px solid rgba(255, 255, 255, 0.22);
1413
+ border-top-color: #fff;
1414
+ border-radius: 50%;
1415
+ animation: spinRing 0.7s linear infinite;
1416
+ }
1417
+
1418
+ /* --- Done badge --- */
1419
+ .done-badge {
1420
+ position: absolute;
1421
+ top: 8px;
1422
+ left: 8px;
1423
+ width: 24px;
1424
+ height: 24px;
1425
+ border-radius: 50%;
1426
+ background: var(--sfx-up-primary, #2563eb);
1427
+ display: flex;
1428
+ align-items: center;
1429
+ justify-content: center;
1430
+ pointer-events: none;
1431
+ z-index: 10;
1432
+ }
1433
+
1434
+ .done-badge svg {
1435
+ width: 14px;
1436
+ height: 14px;
1437
+ }
1438
+
1439
+ /* --- Error / rejected state --- */
1440
+ .error-badge {
1441
+ position: absolute;
1442
+ bottom: 28px;
1443
+ left: 6px;
1444
+ right: 6px;
1445
+ font-size: 12px;
1446
+ font-weight: 600;
1447
+ color: #fff;
1448
+ background: var(--sfx-up-error, #dc2626);
1449
+ border-radius: 4px;
1450
+ padding: 3px 6px;
1451
+ text-align: center;
1452
+ white-space: nowrap;
1453
+ overflow: hidden;
1454
+ text-overflow: ellipsis;
1455
+ }
1456
+
1457
+ .tile.rejected {
1458
+ opacity: 0.6;
1459
+ box-shadow: 0 0 0 2px var(--sfx-up-error, #dc2626);
1460
+ }
1461
+
1462
+ @keyframes tileIn {
1463
+ 0% {
1464
+ opacity: 0;
1465
+ transform: scale(0.92) translateY(14px);
1466
+ }
1467
+ 60% {
1468
+ opacity: 1;
1469
+ }
1470
+ 80% {
1471
+ transform: scale(1.02) translateY(-2px);
1472
+ }
1473
+ 100% {
1474
+ opacity: 1;
1475
+ transform: scale(1) translateY(0);
1476
+ }
1477
+ }
1478
+
1479
+ @keyframes popBounce {
1480
+ 0% { transform: scale(0); opacity: 0; }
1481
+ 55% { transform: scale(1.2); opacity: 1; }
1482
+ 75% { transform: scale(0.94); }
1483
+ 100% { transform: scale(1); }
1484
+ }
1485
+
1486
+ @keyframes spinRing {
1487
+ to { transform: rotate(360deg); }
1488
+ }
1489
+
1490
+ .tile:focus-visible {
1491
+ outline: 2px solid var(--sfx-up-ring, oklch(0.578 0.198 268.129 / 0.7));
1492
+ outline-offset: 2px;
1493
+ }
1494
+
1495
+ .act-btn:focus-visible,
1496
+ .preview-btn:focus-visible {
1497
+ outline: 2px solid var(--sfx-up-ring, oklch(0.578 0.198 268.129 / 0.7));
1498
+ outline-offset: 2px;
1499
+ }
1500
+
1501
+ @media (prefers-reduced-motion: reduce) {
1502
+ .tile { animation: none; }
1503
+ .spin-ring { animation: none; }
1504
+ }
1505
+ `;let K=ce;it([p.property({attribute:!1})],K.prototype,"file");const H=n.css`
1506
+ .btn,
1507
+ .btn-ghost,
1508
+ .btn-primary,
1509
+ .btn-sec,
1510
+ .btn-retry,
1511
+ .btn-upload,
1512
+ .btn-danger {
1513
+ height: 36px;
1514
+ padding: 0 16px;
1515
+ border-radius: 6px;
1516
+ border: none;
1517
+ font-family: inherit;
1518
+ font-size: 14px;
1519
+ font-weight: 500;
1520
+ cursor: pointer;
1521
+ display: inline-flex;
1522
+ align-items: center;
1523
+ justify-content: center;
1524
+ gap: 6px;
1525
+ transition: all 0.15s ease;
1526
+ white-space: nowrap;
1527
+ }
1528
+
1529
+ .btn svg,
1530
+ .btn-ghost svg,
1531
+ .btn-primary svg,
1532
+ .btn-sec svg,
1533
+ .btn-retry svg,
1534
+ .btn-upload svg,
1535
+ .btn-danger svg {
1536
+ width: 14px;
1537
+ height: 14px;
1538
+ }
1539
+
1540
+ .btn-ghost {
1541
+ background: none;
1542
+ color: var(--sfx-up-text-muted, #94a3b8);
1543
+ border: 1.5px solid var(--sfx-up-border, #e2e8f0);
1544
+ }
1545
+
1546
+ .btn-ghost:hover {
1547
+ background: var(--sfx-up-border-light, #f8faff);
1548
+ color: var(--sfx-up-text-secondary, #64748b);
1549
+ border-color: var(--sfx-up-border, #d1dff0);
1550
+ }
1551
+
1552
+ .btn-primary {
1553
+ background: linear-gradient(135deg, var(--sfx-up-primary, #2563eb), var(--sfx-up-primary-mid, #3b82f6));
1554
+ color: var(--primary-foreground, #fff);
1555
+ box-shadow: 0 2px 10px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.28));
1556
+ position: relative;
1557
+ overflow: hidden;
1558
+ }
1559
+
1560
+ .btn-primary:hover:not(:disabled) {
1561
+ background: linear-gradient(135deg, var(--sfx-up-primary-hover, #1d4ed8), var(--sfx-up-primary, #2563eb));
1562
+ box-shadow: 0 4px 16px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.38));
1563
+ transform: translateY(-1px);
1564
+ }
1565
+
1566
+ .btn-primary:active {
1567
+ transform: translateY(0);
1568
+ }
1569
+
1570
+ .btn-primary:disabled {
1571
+ opacity: 0.55;
1572
+ cursor: not-allowed;
1573
+ }
1574
+ `,q=n.css`
1575
+ button:focus-visible {
1576
+ outline: 2px solid var(--sfx-up-ring, oklch(0.578 0.198 268.129 / 0.7));
1577
+ outline-offset: 2px;
1578
+ }
1579
+ `;var st=Object.defineProperty,Q=(a,e,t,r)=>{for(var i=void 0,s=a.length-1,o;s>=0;s--)(o=a[s])&&(i=o(e,t,i)||i);return i&&st(e,t,i),i};const be=7,de=class de extends n.LitElement{constructor(){super(...arguments),this.fileCount=0,this.totalSize=0,this.thumbnails=[],this.primaryLabel="Done"}_uploadMore(){this.dispatchEvent(new CustomEvent("upload-more",{bubbles:!0,composed:!0}))}_primaryAction(){this.dispatchEvent(new CustomEvent("primary-action",{bubbles:!0,composed:!0}))}render(){const e=this.thumbnails.slice(0,be),t=this.thumbnails.length-be;return n.html`
1580
+ <div class="card" role="status" aria-live="polite">
1581
+ <div class="icon">
1582
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
1583
+ <polyline points="20 6 9 17 4 12" />
1584
+ </svg>
1585
+ </div>
1586
+ <div class="title">Uploaded successfully!</div>
1587
+ <div class="subtitle">All files are ready for use</div>
1588
+
1589
+ ${e.length>0?n.html`
1590
+ <div class="thumbs">
1591
+ ${e.map(r=>n.html`<img class="thumb" src=${r} alt="" />`)}
1592
+ ${t>0?n.html`<div class="thumb-more">+${t}</div>`:n.nothing}
1593
+ </div>
1594
+ `:n.nothing}
1595
+
1596
+ <div class="summary">${this.fileCount} ${this.fileCount===1?"file":"files"} · ${V(this.totalSize)} uploaded</div>
1597
+
1598
+ <div class="actions">
1599
+ <button class="btn-ghost" @click=${this._uploadMore}>Upload more</button>
1600
+ <button class="btn-primary" @click=${this._primaryAction}>${this.primaryLabel}</button>
1601
+ </div>
1602
+ </div>
1603
+ `}};de.styles=[H,q,n.css`
1604
+ :host {
1605
+ display: flex;
1606
+ flex: 1;
1607
+ justify-content: center;
1608
+ align-items: center;
1609
+ }
1610
+
1611
+ .card {
1612
+ display: flex;
1613
+ flex-direction: column;
1614
+ align-items: center;
1615
+ text-align: center;
1616
+ animation: fadeUp 0.4s ease both;
1617
+ }
1618
+
1619
+ .icon {
1620
+ width: 64px;
1621
+ height: 64px;
1622
+ border-radius: 50%;
1623
+ background: var(--sfx-up-primary-bg, #eff6ff);
1624
+ display: flex;
1625
+ align-items: center;
1626
+ justify-content: center;
1627
+ margin-bottom: 18px;
1628
+ color: var(--sfx-up-primary, #2563eb);
1629
+ box-shadow: 0 4px 18px var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.12));
1630
+ animation: popBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
1631
+ }
1632
+
1633
+ .icon svg {
1634
+ width: 30px;
1635
+ height: 30px;
1636
+ }
1637
+
1638
+ .title {
1639
+ font-size: 20px;
1640
+ font-weight: 700;
1641
+ color: var(--sfx-up-text, #0f172a);
1642
+ letter-spacing: -0.4px;
1643
+ margin-bottom: 8px;
1644
+ }
1645
+
1646
+ .subtitle {
1647
+ font-size: 14px;
1648
+ color: var(--sfx-up-text-muted, #94a3b8);
1649
+ line-height: 1.6;
1650
+ max-width: 320px;
1651
+ margin-bottom: 20px;
1652
+ }
1653
+
1654
+ /* --- Thumbnail strip --- */
1655
+ .thumbs {
1656
+ display: flex;
1657
+ justify-content: center;
1658
+ gap: 6px;
1659
+ margin-bottom: 14px;
1660
+ }
1661
+
1662
+ .thumb {
1663
+ width: 56px;
1664
+ height: 56px;
1665
+ border-radius: 8px;
1666
+ object-fit: cover;
1667
+ border: 1px solid var(--sfx-up-border, #e8eaed);
1668
+ }
1669
+
1670
+ .thumb-more {
1671
+ width: 56px;
1672
+ height: 56px;
1673
+ border-radius: 8px;
1674
+ background: var(--sfx-up-surface, #f8fafc);
1675
+ border: 1px solid var(--sfx-up-border, #e8eaed);
1676
+ display: flex;
1677
+ align-items: center;
1678
+ justify-content: center;
1679
+ font-size: 14px;
1680
+ font-weight: 600;
1681
+ color: var(--sfx-up-text-muted, #94a3b8);
1682
+ }
1683
+
1684
+ /* --- Summary chip --- */
1685
+ .summary {
1686
+ font-size: 14px;
1687
+ font-weight: 400;
1688
+ color: var(--sfx-up-text, #1e293b);
1689
+ background: var(--sfx-up-surface, #f8fafc);
1690
+ border-radius: 8px;
1691
+ padding: 6px 14px;
1692
+ margin-bottom: 22px;
1693
+ }
1694
+
1695
+ .actions {
1696
+ display: flex;
1697
+ gap: 8px;
1698
+ }
1699
+
1700
+ @keyframes fadeUp {
1701
+ from {
1702
+ opacity: 0;
1703
+ transform: translateY(12px);
1704
+ }
1705
+ to {
1706
+ opacity: 1;
1707
+ transform: translateY(0);
1708
+ }
1709
+ }
1710
+
1711
+ @keyframes popBounce {
1712
+ 0% { transform: scale(0); opacity: 0; }
1713
+ 55% { transform: scale(1.2); opacity: 1; }
1714
+ 75% { transform: scale(0.94); }
1715
+ 100% { transform: scale(1); }
1716
+ }
1717
+
1718
+ @media (max-width: 480px) {
1719
+ .icon { width: 48px; height: 48px; margin-bottom: 12px; }
1720
+ .icon svg { width: 24px; height: 24px; }
1721
+ .title { font-size: 18px; }
1722
+ .thumb, .thumb-more { width: 44px; height: 44px; }
1723
+ }
1724
+
1725
+ @media (prefers-reduced-motion: reduce) {
1726
+ .card { animation: none; }
1727
+ .icon { animation: none; }
1728
+ }
1729
+ `];let D=de;Q([p.property({type:Number})],D.prototype,"fileCount");Q([p.property({type:Number})],D.prototype,"totalSize");Q([p.property({type:Array})],D.prototype,"thumbnails");Q([p.property({type:String})],D.prototype,"primaryLabel");var ot=Object.defineProperty,F=(a,e,t,r)=>{for(var i=void 0,s=a.length-1,o;s>=0;s--)(o=a[s])&&(i=o(e,t,i)||i);return i&&ot(e,t,i),i};const pe=class pe extends n.LitElement{constructor(){super(...arguments),this.uploadState="idle",this.fileCount=0,this.totalSize=0,this.failedCount=0,this.showFillMetadata=!1,this.completedCount=0,this.uploadProgress=0}_clear(){this.dispatchEvent(new CustomEvent("clear-all",{bubbles:!0,composed:!0}))}_addMore(){this.dispatchEvent(new CustomEvent("add-more",{bubbles:!0,composed:!0}))}_fillMetadata(){this.dispatchEvent(new CustomEvent("fill-metadata",{bubbles:!0,composed:!0}))}_upload(){this.dispatchEvent(new CustomEvent("upload-start",{bubbles:!0,composed:!0}))}_retryAll(){this.dispatchEvent(new CustomEvent("retry-all",{bubbles:!0,composed:!0}))}render(){const e=this.uploadState==="uploading";return n.html`
1730
+ ${e?n.html`
1731
+ <div class="progress-row">
1732
+ <div class="progress-track" role="progressbar" aria-valuenow=${Math.round(this.uploadProgress)} aria-valuemin="0" aria-valuemax="100" aria-label="Upload progress">
1733
+ <div class="progress-fill" style="width:${this.uploadProgress}%"></div>
1734
+ </div>
1735
+ <span class="progress-label">${this.completedCount}/${this.fileCount} files</span>
1736
+ </div>
1737
+ `:n.nothing}
1738
+ <div class="buttons-row">
1739
+ <div class="left">
1740
+ ${this.showFillMetadata&&this.uploadState==="idle"?n.html`
1741
+ <button class="btn-sec" @click=${this._fillMetadata}>
1742
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
1743
+ <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
1744
+ <polyline points="14 2 14 8 20 8"/>
1745
+ <line x1="16" y1="13" x2="8" y2="13"/>
1746
+ <line x1="16" y1="17" x2="8" y2="17"/>
1747
+ <line x1="10" y1="9" x2="8" y2="9"/>
1748
+ </svg>
1749
+ Fill Metadata
1750
+ </button>
1751
+ `:n.nothing}
1752
+ </div>
1753
+ <div class="right">
1754
+ <button class="btn-ghost" @click=${this._clear}>
1755
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
1756
+ <path d="M3 6h18" />
1757
+ <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" />
1758
+ <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" />
1759
+ <line x1="10" y1="11" x2="10" y2="17" />
1760
+ <line x1="14" y1="11" x2="14" y2="17" />
1761
+ </svg>
1762
+ Clear
1763
+ </button>
1764
+ <button class="btn-sec" @click=${this._addMore}>
1765
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round">
1766
+ <line x1="12" y1="5" x2="12" y2="19" />
1767
+ <line x1="5" y1="12" x2="19" y2="12" />
1768
+ </svg>
1769
+ Add more
1770
+ </button>
1771
+ ${this.failedCount>0?n.html`
1772
+ <button class="btn-retry" @click=${this._retryAll}>
1773
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round">
1774
+ <polyline points="23 4 23 10 17 10" />
1775
+ <path d="M20.49 15a9 9 0 11-2.12-9.36L23 10" />
1776
+ </svg>
1777
+ Retry all (${this.failedCount})
1778
+ </button>
1779
+ `:n.nothing}
1780
+ ${this._renderUploadButton()}
1781
+ </div>
1782
+ </div>
1783
+ `}_renderUploadButton(){const e=this.uploadState==="uploading",t=this.uploadState==="done",r=["btn-primary",t?"done-state":""].filter(Boolean).join(" ");return n.html`
1784
+ <button
1785
+ class=${r}
1786
+ @click=${this._upload}
1787
+ ?disabled=${e}
1788
+ >
1789
+ ${e?n.html`<span class="btn-spin"></span> Uploading\u2026`:t?n.html`
1790
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
1791
+ <polyline points="20 6 9 17 4 12" />
1792
+ </svg>
1793
+ Done!
1794
+ `:n.html`
1795
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round">
1796
+ <polyline points="16 16 12 12 8 16" />
1797
+ <line x1="12" y1="12" x2="12" y2="21" />
1798
+ <path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3" />
1799
+ </svg>
1800
+ Upload
1801
+ `}
1802
+ </button>
1803
+ `}};pe.styles=[H,q,n.css`
1804
+ :host {
1805
+ display: flex;
1806
+ flex-direction: column;
1807
+ background: var(--sfx-up-bg, #ffffff);
1808
+ border-top: 1px solid var(--sfx-up-border, #e2e8f0);
1809
+ flex-shrink: 0;
1810
+ box-shadow: none;
1811
+ animation: barSlideUp 0.3s cubic-bezier(0.34, 1.2, 0.64, 1) both;
1812
+ }
1813
+
1814
+ @keyframes barSlideUp {
1815
+ from {
1816
+ opacity: 0;
1817
+ transform: translateY(12px);
1818
+ }
1819
+ to {
1820
+ opacity: 1;
1821
+ transform: translateY(0);
1822
+ }
1823
+ }
1824
+
1825
+ /* --- Progress row --- */
1826
+ .progress-row {
1827
+ display: flex;
1828
+ align-items: center;
1829
+ gap: 12px;
1830
+ padding: 10px 24px 0;
1831
+ }
1832
+
1833
+ .progress-track {
1834
+ flex: 1;
1835
+ height: 4px;
1836
+ background: var(--sfx-up-border, #e2e8f0);
1837
+ border-radius: 2px;
1838
+ overflow: hidden;
1839
+ }
1840
+
1841
+ .progress-fill {
1842
+ height: 100%;
1843
+ background: var(--sfx-up-primary, #2563eb);
1844
+ border-radius: 2px;
1845
+ transition: width 0.3s ease;
1846
+ }
1847
+
1848
+ .progress-label {
1849
+ font-size: 13px;
1850
+ font-weight: 600;
1851
+ color: var(--sfx-up-text, #1e293b);
1852
+ white-space: nowrap;
1853
+ flex-shrink: 0;
1854
+ }
1855
+
1856
+ /* --- Buttons row --- */
1857
+ .buttons-row {
1858
+ display: flex;
1859
+ align-items: center;
1860
+ justify-content: space-between;
1861
+ padding: 14px 24px;
1862
+ }
1863
+
1864
+ .left {
1865
+ display: flex;
1866
+ align-items: center;
1867
+ gap: 8px;
1868
+ }
1869
+
1870
+ .right {
1871
+ display: flex;
1872
+ align-items: center;
1873
+ gap: 8px;
1874
+ }
1875
+
1876
+ /* --- Button overrides (base in shared-styles) --- */
1877
+
1878
+ .btn-sec {
1879
+ background: var(--sfx-up-primary-bg, #eff6ff);
1880
+ color: var(--sfx-up-primary, #2563eb);
1881
+ border: 1.5px solid var(--sfx-up-primary-glow, rgba(37, 99, 235, 0.15));
1882
+ }
1883
+
1884
+ .btn-sec:hover {
1885
+ background: var(--sfx-up-primary-bg, #dbeafe);
1886
+ }
1887
+
1888
+ .btn-retry {
1889
+ background: var(--destructive-10, #fef2f2);
1890
+ color: var(--sfx-up-error, #dc2626);
1891
+ border: 1.5px solid var(--sfx-up-error, rgba(220, 38, 38, 0.2));
1892
+ }
1893
+
1894
+ .btn-retry:hover {
1895
+ background: var(--destructive-10, #fee2e2);
1896
+ color: var(--destructive-foreground, #b91c1c);
1897
+ border-color: var(--sfx-up-error, rgba(220, 38, 38, 0.35));
1898
+ }
1899
+
1900
+ .btn-primary {
1901
+ min-width: 110px;
1902
+ }
1903
+
1904
+ .btn-primary.done-state {
1905
+ background: var(--sfx-up-success, #16a34a);
1906
+ box-shadow: 0 2px 10px var(--sfx-up-shadow, rgba(22, 163, 74, 0.28));
1907
+ }
1908
+
1909
+ /* --- Spinner --- */
1910
+ .btn-spin {
1911
+ width: 14px;
1912
+ height: 14px;
1913
+ border: 2px solid rgba(255, 255, 255, 0.3);
1914
+ border-top-color: #fff;
1915
+ border-radius: 50%;
1916
+ animation: spinRing 0.7s linear infinite;
1917
+ }
1918
+
1919
+ /* --- Count --- */
1920
+ .count {
1921
+ font-size: 14px;
1922
+ font-weight: 700;
1923
+ color: var(--sfx-up-text, #1e293b);
1924
+ }
1925
+
1926
+ .count span {
1927
+ font-weight: 400;
1928
+ color: var(--sfx-up-text-muted, #94a3b8);
1929
+ }
1930
+
1931
+ @keyframes spinRing {
1932
+ to { transform: rotate(360deg); }
1933
+ }
1934
+
1935
+ @media (max-width: 480px) {
1936
+ .buttons-row {
1937
+ padding: 10px 12px;
1938
+ flex-wrap: wrap;
1939
+ gap: 8px;
1940
+ }
1941
+ button {
1942
+ height: 32px;
1943
+ font-size: 12px;
1944
+ }
1945
+ }
1946
+
1947
+ @media (prefers-reduced-motion: reduce) {
1948
+ :host { animation: none; }
1949
+ .btn-spin { animation: none; }
1950
+ }
1951
+ `];let $=pe;F([p.property({type:String})],$.prototype,"uploadState");F([p.property({type:Number})],$.prototype,"fileCount");F([p.property({type:Number})],$.prototype,"totalSize");F([p.property({type:Number})],$.prototype,"failedCount");F([p.property({type:Boolean})],$.prototype,"showFillMetadata");F([p.property({type:Number})],$.prototype,"completedCount");F([p.property({type:Number})],$.prototype,"uploadProgress");const at='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function ie(a,e){return t=>{if(t.key!=="Tab")return;const r=a();if(!r)return;const i=r.querySelector(e);if(!i)return;const s=Array.from(i.querySelectorAll(at));if(s.length===0)return;const o=s[0],l=s[s.length-1],c=r.activeElement;t.shiftKey?(c===o||!i.contains(c))&&(t.preventDefault(),l.focus()):(c===l||!i.contains(c))&&(t.preventDefault(),o.focus())}}var nt=Object.defineProperty,se=(a,e,t,r)=>{for(var i=void 0,s=a.length-1,o;s>=0;s--)(o=a[s])&&(i=o(e,t,i)||i);return i&&nt(e,t,i),i};const he=class he extends n.LitElement{constructor(){super(...arguments),this._url="",this._name="",this._error="",this._onBackdropClick=e=>{e.target===e.currentTarget&&this._cancel()},this._onUrlInput=e=>{this._url=e.target.value,this._error="",this._autoName()},this._onNameInput=e=>{this._name=e.target.value},this._focusTrap=ie(()=>this.shadowRoot,".card"),this._onKeyDown=e=>{var t;e.key==="Escape"&&this._cancel(),e.key==="Enter"&&((t=e.target)==null?void 0:t.tagName)==="INPUT"&&this._submit(),this._focusTrap(e)}}_autoName(){var e;if(!this._name)try{const t=new URL(this._url).pathname.split("/"),r=t[t.length-1];if(r){const i=(e=this.shadowRoot)==null?void 0:e.querySelector("#nameInput");i&&(i.placeholder=r)}}catch{}}_cancel(){this.dispatchEvent(new CustomEvent("url-cancel",{bubbles:!0,composed:!0}))}_submit(){const e=this._url.trim();if(!e){this._error="Please enter a URL";return}try{new URL(e)}catch{this._error="Please enter a valid URL";return}this._error="";let t=this._name.trim();if(!t)try{const r=new URL(e).pathname.split("/");t=r[r.length-1]||"imported-file"}catch{t="imported-file"}this.dispatchEvent(new CustomEvent("url-submit",{detail:{url:e,name:t},bubbles:!0,composed:!0}))}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{var e,t;(t=(e=this.shadowRoot)==null?void 0:e.querySelector("#urlInput"))==null||t.focus()})}render(){return n.html`
1952
+ <div class="backdrop" @click=${this._onBackdropClick} @keydown=${this._onKeyDown}>
1953
+ <div class="card">
1954
+ <div class="head">
1955
+ <div class="head-icon">
1956
+ <svg viewBox="0 0 24 24">
1957
+ <path d="M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71" />
1958
+ <path d="M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71" />
1959
+ </svg>
1960
+ </div>
1961
+ <div class="title">Import from URL</div>
1962
+ <button class="close-btn" aria-label="Close" @click=${this._cancel}>\u2715</button>
1963
+ </div>
1964
+ <div class="body">
1965
+ <div class="field">
1966
+ <label for="urlInput">File URL</label>
1967
+ <input
1968
+ id="urlInput"
1969
+ type="url"
1970
+ placeholder="https://example.com/file.pdf"
1971
+ .value=${this._url}
1972
+ @input=${this._onUrlInput}
1973
+ />
1974
+ </div>
1975
+ <div class="field">
1976
+ <label for="nameInput">File name <span class="optional">(optional)</span></label>
1977
+ <input
1978
+ id="nameInput"
1979
+ type="text"
1980
+ placeholder="document.pdf"
1981
+ .value=${this._name}
1982
+ @input=${this._onNameInput}
1983
+ />
1984
+ </div>
1985
+ ${this._error?n.html`<div class="error">${this._error}</div>`:""}
1986
+ <div class="actions">
1987
+ <button class="btn btn-ghost" @click=${this._cancel}>Cancel</button>
1988
+ <button class="btn btn-primary" @click=${this._submit}>
1989
+ Import file
1990
+ </button>
1991
+ </div>
1992
+ </div>
1993
+ </div>
1994
+ </div>
1995
+ `}};he.styles=[H,q,n.css`
1996
+ :host {
1997
+ display: block;
1998
+ }
1999
+
2000
+ .backdrop {
2001
+ position: fixed;
2002
+ inset: 0;
2003
+ z-index: 1000;
2004
+ background: var(--sfx-up-backdrop, rgba(0, 0, 0, 0.45));
2005
+ backdrop-filter: blur(6px);
2006
+ display: flex;
2007
+ align-items: center;
2008
+ justify-content: center;
2009
+ padding: 20px;
2010
+ animation: fadeIn 0.18s ease both;
2011
+ }
2012
+
2013
+ .card {
2014
+ background: var(--sfx-up-bg, #fff);
2015
+ border-radius: 12px;
2016
+ box-shadow: 0 28px 80px var(--sfx-up-shadow, rgba(0, 0, 0, 0.18)), 0 4px 16px rgba(0, 0, 0, 0.06);
2017
+ width: 100%;
2018
+ max-width: 480px;
2019
+ overflow: hidden;
2020
+ display: flex;
2021
+ flex-direction: column;
2022
+ transform: translateY(18px) scale(0.97);
2023
+ animation: slideUp 0.28s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
2024
+ }
2025
+
2026
+ .head {
2027
+ display: flex;
2028
+ align-items: center;
2029
+ gap: 10px;
2030
+ padding: 18px 20px 0;
2031
+ }
2032
+
2033
+ .head-icon {
2034
+ width: 32px;
2035
+ height: 32px;
2036
+ border-radius: 8px;
2037
+ background: var(--sfx-up-primary-bg, #f5f5f7);
2038
+ display: flex;
2039
+ align-items: center;
2040
+ justify-content: center;
2041
+ flex-shrink: 0;
2042
+ color: var(--sfx-up-primary, #2563eb);
2043
+ }
2044
+
2045
+ .head-icon svg {
2046
+ width: 18px;
2047
+ height: 18px;
2048
+ fill: none;
2049
+ stroke: currentColor;
2050
+ stroke-width: 2;
2051
+ stroke-linecap: round;
2052
+ }
2053
+
2054
+ .title {
2055
+ font-size: 16px;
2056
+ font-weight: 700;
2057
+ color: var(--sfx-up-text, #1a1a1a);
2058
+ flex: 1;
2059
+ }
2060
+
2061
+ .close-btn {
2062
+ width: 28px;
2063
+ height: 28px;
2064
+ border-radius: 8px;
2065
+ border: none;
2066
+ background: var(--sfx-up-border-light, #f0f0f0);
2067
+ color: var(--sfx-up-text-muted, #888);
2068
+ font-size: 14px;
2069
+ cursor: pointer;
2070
+ display: flex;
2071
+ align-items: center;
2072
+ justify-content: center;
2073
+ transition: background 0.15s, color 0.15s;
2074
+ flex-shrink: 0;
2075
+ line-height: 1;
2076
+ }
2077
+
2078
+ .close-btn:hover {
2079
+ background: var(--sfx-up-border, #e4e4e4);
2080
+ color: var(--sfx-up-text, #333);
2081
+ }
2082
+
2083
+ .body {
2084
+ padding: 18px 20px 20px;
2085
+ }
2086
+
2087
+ .field {
2088
+ margin-bottom: 14px;
2089
+ }
2090
+
2091
+ label {
2092
+ display: block;
2093
+ font-size: 12px;
2094
+ font-weight: 600;
2095
+ color: var(--sfx-up-text-muted, #aaa);
2096
+ margin-bottom: 5px;
2097
+ text-transform: uppercase;
2098
+ letter-spacing: 0.7px;
2099
+ }
2100
+
2101
+ label .optional {
2102
+ color: var(--sfx-up-border, #ccc);
2103
+ font-weight: 400;
2104
+ text-transform: none;
2105
+ letter-spacing: 0;
2106
+ }
2107
+
2108
+ input {
2109
+ width: 100%;
2110
+ height: 40px;
2111
+ border: 1.5px solid var(--sfx-up-border, #ebebeb);
2112
+ border-radius: 6px;
2113
+ padding: 0 14px;
2114
+ font-size: 14px;
2115
+ font-family: inherit;
2116
+ color: var(--sfx-up-text, #1a1a1a);
2117
+ background: var(--sfx-up-border-light, #fafafa);
2118
+ transition: border-color 0.15s, background 0.15s;
2119
+ outline: none;
2120
+ box-sizing: border-box;
2121
+ }
2122
+
2123
+ input:focus {
2124
+ border-color: var(--sfx-up-primary, #2563eb);
2125
+ background: var(--sfx-up-bg, #fff);
2126
+ }
2127
+
2128
+ input::placeholder {
2129
+ color: var(--sfx-up-text-muted, #ccc);
2130
+ text-align: center;
2131
+ }
2132
+
2133
+ .error {
2134
+ font-size: 12px;
2135
+ color: var(--sfx-up-error, #dc2626);
2136
+ margin-top: -6px;
2137
+ margin-bottom: 8px;
2138
+ }
2139
+
2140
+ .actions {
2141
+ display: flex;
2142
+ gap: 8px;
2143
+ justify-content: flex-end;
2144
+ margin-top: 18px;
2145
+ }
2146
+
2147
+
2148
+
2149
+ @keyframes fadeIn {
2150
+ from { opacity: 0; }
2151
+ to { opacity: 1; }
2152
+ }
2153
+
2154
+ @keyframes slideUp {
2155
+ from { transform: translateY(18px) scale(0.97); }
2156
+ to { transform: translateY(0) scale(1); }
2157
+ }
2158
+
2159
+ .close-btn:focus-visible {
2160
+ outline: 2px solid var(--sfx-up-primary, #2563eb);
2161
+ outline-offset: 2px;
2162
+ }
2163
+
2164
+ input:focus-visible {
2165
+ outline: none;
2166
+ }
2167
+
2168
+ `];let j=he;se([p.state()],j.prototype,"_url");se([p.state()],j.prototype,"_name");se([p.state()],j.prototype,"_error");var lt=Object.defineProperty,ee=(a,e,t,r)=>{for(var i=void 0,s=a.length-1,o;s>=0;s--)(o=a[s])&&(i=o(e,t,i)||i);return i&&lt(e,t,i),i};const ue=class ue extends n.LitElement{constructor(){super(...arguments),this._stream=null,this._error="",this._captured=null,this._previewUrl="",this._onBackdropClick=e=>{e.target===e.currentTarget&&this._cancel()},this._focusTrap=ie(()=>this.shadowRoot,".card"),this._onKeyDown=e=>{e.key==="Escape"&&this._cancel(),this._focusTrap(e)},this._capture=()=>{var i,s;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("video"),t=(s=this.shadowRoot)==null?void 0:s.querySelector("canvas");if(!e||!t)return;t.width=e.videoWidth,t.height=e.videoHeight,t.getContext("2d").drawImage(e,0,0),t.toBlob(o=>{o&&(this._captured=o,this._previewUrl=URL.createObjectURL(o),this._stopStream())},"image/jpeg",.92)},this._retake=()=>{this._previewUrl&&URL.revokeObjectURL(this._previewUrl),this._captured=null,this._previewUrl="",this._startCamera()},this._usePhoto=()=>{if(!this._captured)return;const e=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),t=new File([this._captured],`camera-${e}.jpg`,{type:"image/jpeg"});this.dispatchEvent(new CustomEvent("camera-capture",{detail:{file:t},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this._startCamera()}disconnectedCallback(){super.disconnectedCallback(),this._stopStream(),this._previewUrl&&URL.revokeObjectURL(this._previewUrl)}async _startCamera(){var e;try{this._stream=await navigator.mediaDevices.getUserMedia({video:!0,audio:!1}),await this.updateComplete;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("video");t&&(t.srcObject=this._stream)}catch{this._error="Could not access camera. Please check your permissions."}}_stopStream(){var e;(e=this._stream)==null||e.getTracks().forEach(t=>t.stop()),this._stream=null}_cancel(){this._stopStream(),this.dispatchEvent(new CustomEvent("camera-cancel",{bubbles:!0,composed:!0}))}render(){return n.html`
2169
+ <div class="backdrop" @click=${this._onBackdropClick} @keydown=${this._onKeyDown}>
2170
+ <div class="card">
2171
+ <div class="head">
2172
+ <div class="head-icon">
2173
+ <svg viewBox="0 0 24 24">
2174
+ <path d="M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z"/>
2175
+ <circle cx="12" cy="13" r="4"/>
2176
+ </svg>
2177
+ </div>
2178
+ <div class="title">Camera</div>
2179
+ <button class="close-btn" aria-label="Close" @click=${this._cancel}>\u2715</button>
2180
+ </div>
2181
+ <div class="body">
2182
+ ${this._error?n.html`<div class="error">${this._error}</div>`:this._captured?n.html`
2183
+ <img class="preview-img" src=${this._previewUrl} alt="Captured photo" />
2184
+ <div class="actions">
2185
+ <button class="btn btn-ghost" @click=${this._retake}>Retake</button>
2186
+ <button class="btn btn-primary" @click=${this._usePhoto}>Use photo</button>
2187
+ </div>
2188
+ `:n.html`
2189
+ <video autoplay playsinline muted></video>
2190
+ <canvas></canvas>
2191
+ <div class="actions">
2192
+ <button class="btn-capture" @click=${this._capture}></button>
2193
+ </div>
2194
+ `}
2195
+ </div>
2196
+ </div>
2197
+ </div>
2198
+ `}};ue.styles=[H,q,n.css`
2199
+ :host { display: block; }
2200
+
2201
+ .backdrop {
2202
+ position: fixed; inset: 0; z-index: 1000;
2203
+ background: var(--sfx-up-backdrop, rgba(0, 0, 0, 0.45));
2204
+ backdrop-filter: blur(6px);
2205
+ display: flex; align-items: center; justify-content: center;
2206
+ padding: 20px;
2207
+ animation: fadeIn 0.18s ease both;
2208
+ }
2209
+
2210
+ .card {
2211
+ background: var(--sfx-up-bg, #fff);
2212
+ border-radius: 12px;
2213
+ box-shadow: 0 28px 80px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.06);
2214
+ width: 100%; max-width: 520px;
2215
+ height: 520px;
2216
+ overflow: hidden; display: flex; flex-direction: column;
2217
+ animation: slideUp 0.28s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
2218
+ }
2219
+
2220
+ .head {
2221
+ display: flex; align-items: center; gap: 10px;
2222
+ padding: 18px 20px 0;
2223
+ }
2224
+
2225
+ .head-icon {
2226
+ width: 32px; height: 32px; border-radius: 8px;
2227
+ background: var(--sfx-up-primary-bg, #f5f5f7);
2228
+ display: flex; align-items: center; justify-content: center;
2229
+ flex-shrink: 0; color: var(--sfx-up-primary, #2563eb);
2230
+ }
2231
+
2232
+ .head-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
2233
+
2234
+ .title { font-size: 16px; font-weight: 700; color: var(--sfx-up-text, #1a1a1a); flex: 1; }
2235
+
2236
+ .close-btn {
2237
+ width: 28px; height: 28px; border-radius: 8px; border: none;
2238
+ background: var(--sfx-up-border-light, #f0f0f0); color: var(--sfx-up-text-muted, #888); font-size: 14px; cursor: pointer;
2239
+ display: flex; align-items: center; justify-content: center;
2240
+ transition: background 0.15s, color 0.15s; flex-shrink: 0; line-height: 1;
2241
+ }
2242
+ .close-btn:hover { background: var(--sfx-up-border, #e4e4e4); color: var(--sfx-up-text, #333); }
2243
+
2244
+ .body { padding: 18px 20px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; flex: 1; min-height: 0; justify-content: center; }
2245
+
2246
+ video, canvas {
2247
+ width: 100%; flex: 1; min-height: 0; border-radius: 12px;
2248
+ background: #000; object-fit: cover;
2249
+ }
2250
+
2251
+ canvas { display: none; }
2252
+
2253
+ .preview-img {
2254
+ width: 100%; max-height: 320px; border-radius: 12px;
2255
+ object-fit: contain; background: #000;
2256
+ }
2257
+
2258
+ .error { font-size: 13px; color: var(--sfx-up-error, #dc2626); text-align: center; padding: 40px 20px; }
2259
+
2260
+ .actions { display: flex; gap: 8px; justify-content: center; width: 100%; }
2261
+
2262
+ .btn-capture {
2263
+ width: 52px; height: 52px; border-radius: 50%; padding: 0;
2264
+ background: var(--sfx-up-error, #dc2626); border: 4px solid var(--sfx-up-bg, #fff);
2265
+ box-shadow: 0 0 0 2px var(--sfx-up-error, #dc2626), 0 4px 12px var(--sfx-up-shadow, rgba(220, 38, 38, 0.3));
2266
+ cursor: pointer; transition: all 0.15s;
2267
+ }
2268
+ .btn-capture:hover { background: var(--destructive-foreground, #b91c1c); transform: scale(1.05); }
2269
+
2270
+ .close-btn:focus-visible,
2271
+ .btn-capture:focus-visible {
2272
+ outline: 2px solid var(--sfx-up-primary, #2563eb);
2273
+ outline-offset: 2px;
2274
+ }
2275
+
2276
+ @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
2277
+ @keyframes slideUp { from { transform: translateY(18px) scale(0.97); } to { transform: translateY(0) scale(1); } }
2278
+ `];let z=ue;ee([p.state()],z.prototype,"_stream");ee([p.state()],z.prototype,"_error");ee([p.state()],z.prototype,"_captured");ee([p.state()],z.prototype,"_previewUrl");var ct=Object.defineProperty,Y=(a,e,t,r)=>{for(var i=void 0,s=a.length-1,o;s>=0;s--)(o=a[s])&&(i=o(e,t,i)||i);return i&&ct(e,t,i),i};const fe=class fe extends n.LitElement{constructor(){super(...arguments),this._stream=null,this._recording=!1,this._error="",this._recordedBlob=null,this._previewUrl="",this._recorder=null,this._chunks=[],this._onBackdropClick=e=>{e.target===e.currentTarget&&this._cancel()},this._focusTrap=ie(()=>this.shadowRoot,".card"),this._onKeyDown=e=>{e.key==="Escape"&&this._cancel(),this._focusTrap(e)},this._startRecording=async()=>{var e;try{this._stream=await navigator.mediaDevices.getDisplayMedia({video:{width:1280,height:720,frameRate:5},audio:!0}),this._stream.getVideoTracks()[0].addEventListener("ended",()=>{this._stopRecording()}),this._recording=!0,await this.updateComplete;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("video");t&&(t.srcObject=this._stream),this._chunks=[];const r=MediaRecorder.isTypeSupported("video/webm;codecs=vp9")?"video/webm;codecs=vp9":"video/webm";this._recorder=new MediaRecorder(this._stream,{mimeType:r}),this._recorder.ondataavailable=i=>{i.data.size>0&&this._chunks.push(i.data)},this._recorder.onstop=()=>{var s;const i=new Blob(this._chunks,{type:"video/webm"});this._recordedBlob=i,this._previewUrl=URL.createObjectURL(i),(s=this._stream)==null||s.getTracks().forEach(o=>o.stop()),this._stream=null},this._recorder.start()}catch{this._error="Could not start screen capture. Please check your permissions."}},this._stopRecording=()=>{var e;this._recording=!1,((e=this._recorder)==null?void 0:e.state)==="recording"&&this._recorder.stop(),this._recorder=null},this._useRecording=()=>{if(!this._recordedBlob)return;const e=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),t=new File([this._recordedBlob],`screencap-${e}.webm`,{type:"video/webm"});this.dispatchEvent(new CustomEvent("screencast-capture",{detail:{file:t},bubbles:!0,composed:!0}))},this._discard=()=>{this._previewUrl&&URL.revokeObjectURL(this._previewUrl),this._recordedBlob=null,this._previewUrl=""}}disconnectedCallback(){super.disconnectedCallback(),this._stopAll(),this._previewUrl&&URL.revokeObjectURL(this._previewUrl)}_stopAll(){var e,t;(e=this._recorder)==null||e.stop(),this._recorder=null,(t=this._stream)==null||t.getTracks().forEach(r=>r.stop()),this._stream=null}_cancel(){this._stopAll(),this.dispatchEvent(new CustomEvent("screencast-cancel",{bubbles:!0,composed:!0}))}render(){return n.html`
2279
+ <div class="backdrop" @click=${this._onBackdropClick} @keydown=${this._onKeyDown}>
2280
+ <div class="card">
2281
+ <div class="head">
2282
+ <div class="head-icon">
2283
+ <svg viewBox="0 0 24 24">
2284
+ <rect x="2" y="3" width="20" height="14" rx="2"/>
2285
+ <circle cx="12" cy="10" r="3"/>
2286
+ <path d="M7 21h10"/>
2287
+ </svg>
2288
+ </div>
2289
+ <div class="title">Screen cast</div>
2290
+ <button class="close-btn" aria-label="Close" @click=${this._cancel}>\u2715</button>
2291
+ </div>
2292
+ <div class="body">
2293
+ ${this._error?n.html`<div class="error">${this._error}</div>`:this._recordedBlob?n.html`
2294
+ <video src=${this._previewUrl} controls></video>
2295
+ <div class="actions">
2296
+ <button class="btn btn-ghost" @click=${this._discard}>Discard</button>
2297
+ <button class="btn btn-primary" @click=${this._useRecording}>Use recording</button>
2298
+ </div>
2299
+ `:this._recording?n.html`
2300
+ <video autoplay playsinline muted></video>
2301
+ <div class="status"><div class="rec-dot"></div> Recording...</div>
2302
+ <div class="actions">
2303
+ <button class="btn btn-danger" @click=${this._stopRecording}>Stop recording</button>
2304
+ </div>
2305
+ `:n.html`
2306
+ <div class="start-view">
2307
+ <div class="start-icon">
2308
+ <svg viewBox="0 0 24 24">
2309
+ <rect x="2" y="3" width="20" height="14" rx="2"/>
2310
+ <circle cx="12" cy="10" r="3"/>
2311
+ <path d="M7 21h10"/>
2312
+ </svg>
2313
+ </div>
2314
+ <div class="start-text">Share your screen to record a video that will be added to your uploads.</div>
2315
+ <div class="actions">
2316
+ <button class="btn btn-ghost" @click=${this._cancel}>Cancel</button>
2317
+ <button class="btn btn-primary" @click=${this._startRecording}>Start recording</button>
2318
+ </div>
2319
+ </div>
2320
+ `}
2321
+ </div>
2322
+ </div>
2323
+ </div>
2324
+ `}};fe.styles=[H,q,n.css`
2325
+ :host { display: block; }
2326
+
2327
+ .backdrop {
2328
+ position: fixed; inset: 0; z-index: 1000;
2329
+ background: var(--sfx-up-backdrop, rgba(0, 0, 0, 0.45));
2330
+ backdrop-filter: blur(6px);
2331
+ display: flex; align-items: center; justify-content: center;
2332
+ padding: 20px;
2333
+ animation: fadeIn 0.18s ease both;
2334
+ }
2335
+
2336
+ .card {
2337
+ background: var(--sfx-up-bg, #fff);
2338
+ border-radius: 12px;
2339
+ box-shadow: 0 28px 80px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.06);
2340
+ width: 100%; max-width: 560px;
2341
+ overflow: hidden; display: flex; flex-direction: column;
2342
+ animation: slideUp 0.28s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
2343
+ }
2344
+
2345
+ .head {
2346
+ display: flex; align-items: center; gap: 10px;
2347
+ padding: 18px 20px 0;
2348
+ }
2349
+
2350
+ .head-icon {
2351
+ width: 32px; height: 32px; border-radius: 8px;
2352
+ background: var(--sfx-up-primary-bg, #f5f5f7);
2353
+ display: flex; align-items: center; justify-content: center;
2354
+ flex-shrink: 0; color: var(--sfx-up-primary, #2563eb);
2355
+ }
2356
+
2357
+ .head-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
2358
+
2359
+ .title { font-size: 16px; font-weight: 700; color: var(--sfx-up-text, #1a1a1a); flex: 1; }
2360
+
2361
+ .close-btn {
2362
+ width: 28px; height: 28px; border-radius: 8px; border: none;
2363
+ background: var(--sfx-up-border-light, #f0f0f0); color: var(--sfx-up-text-muted, #888); font-size: 14px; cursor: pointer;
2364
+ display: flex; align-items: center; justify-content: center;
2365
+ transition: background 0.15s, color 0.15s; flex-shrink: 0; line-height: 1;
2366
+ }
2367
+ .close-btn:hover { background: var(--sfx-up-border, #e4e4e4); color: var(--sfx-up-text, #333); }
2368
+
2369
+ .body { padding: 18px 20px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
2370
+
2371
+ video {
2372
+ width: 100%; max-height: 320px; border-radius: 12px;
2373
+ background: #000; object-fit: contain;
2374
+ }
2375
+
2376
+ .error { font-size: 13px; color: var(--sfx-up-error, #dc2626); text-align: center; padding: 40px 20px; }
2377
+
2378
+ .status {
2379
+ font-size: 13px; color: var(--sfx-up-text-secondary, #475569);
2380
+ display: flex; align-items: center; gap: 8px;
2381
+ }
2382
+
2383
+ .rec-dot {
2384
+ width: 10px; height: 10px; border-radius: 50%;
2385
+ background: var(--sfx-up-error, #dc2626); animation: pulse 1s ease-in-out infinite;
2386
+ }
2387
+
2388
+ .actions { display: flex; gap: 8px; justify-content: center; width: 100%; }
2389
+
2390
+ .btn-danger {
2391
+ background: var(--sfx-up-error, #dc2626); color: var(--primary-foreground, #fff);
2392
+ box-shadow: 0 2px 10px var(--sfx-up-shadow, rgba(220, 38, 38, 0.28));
2393
+ }
2394
+ .btn-danger:hover { background: var(--destructive-foreground, #b91c1c); }
2395
+
2396
+ .start-view {
2397
+ display: flex; flex-direction: column; align-items: center; gap: 16px;
2398
+ padding: 30px 20px; text-align: center;
2399
+ }
2400
+
2401
+ .start-icon {
2402
+ width: 56px; height: 56px; border-radius: 16px;
2403
+ background: var(--sfx-up-primary-bg, #eff6ff);
2404
+ color: var(--sfx-up-primary, #2563eb);
2405
+ display: flex; align-items: center; justify-content: center;
2406
+ }
2407
+
2408
+ .start-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
2409
+
2410
+ .start-text {
2411
+ font-size: 14px; color: var(--sfx-up-text-secondary, #475569); max-width: 300px;
2412
+ }
2413
+
2414
+ .close-btn:focus-visible {
2415
+ outline: 2px solid var(--sfx-up-primary, #2563eb);
2416
+ outline-offset: 2px;
2417
+ }
2418
+
2419
+ @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
2420
+ @keyframes slideUp { from { transform: translateY(18px) scale(0.97); } to { transform: translateY(0) scale(1); } }
2421
+ @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
2422
+ `];let P=fe;Y([p.state()],P.prototype,"_stream");Y([p.state()],P.prototype,"_recording");Y([p.state()],P.prototype,"_error");Y([p.state()],P.prototype,"_recordedBlob");Y([p.state()],P.prototype,"_previewUrl");var dt=Object.defineProperty,C=(a,e,t,r)=>{for(var i=void 0,s=a.length-1,o;s>=0;s--)(o=a[s])&&(i=o(e,t,i)||i);return i&&dt(e,t,i),i};const ye=new Set(["unsplash"]);var w;const _=(w=class extends n.LitElement{constructor(){super(),this.config=null,this._isOpen=!1,this._activeConnector=null,this._showUrlDialog=!1,this._showCameraDialog=!1,this._showScreenCastDialog=!1,this._previewFileId=null,this._previewDims="—",this._fullscreenPreviewUrl=null,this._fullscreenZoomed=!1,this._fsPanX=0,this._fsPanY=0,this._fsDragging=!1,this._fsDragStartX=0,this._fsDragStartY=0,this._fsPanStartX=0,this._fsPanStartY=0,this._bodyDragOver=!1,this._bodyDragCounter=0,this._engine=null,this._cachedSources=M,this._cachedSourcesConfig=void 0,this._rejectedTimers=new Map,this._apiBase=null,this._authHeaders=null,this._authResolveId=0,this._prevStoreState=null,this._unsubStoreEvents=null,this._onFilesSelected=e=>{this._processIncomingFiles(e.detail.files)},this._onSourceClick=async e=>{var s,o;const t=e.detail.source,r=this._mergedSources.find(l=>l.id===t);if(r!=null&&r.onActivate){try{r.onActivate(this)}catch(l){console.error(`[sfx-uploader] onActivate for custom source "${t}" threw:`,l)}return}if(t==="device"){const l=this.shadowRoot.querySelector("sfx-drop-zone");l==null||l.browse();return}if(t==="url"){this._showUrlDialog=!0;return}if(t==="camera"){this._showCameraDialog=!0;return}if(t==="screen-cast"){this._showScreenCastDialog=!0;return}if((((o=(s=this.config)==null?void 0:s.connectors)==null?void 0:o.providers)??[]).includes(t)){if(ye.has(t)){if(!customElements.get("sfx-search-provider-browser")){const{SfxSearchProviderBrowser:c}=await Promise.resolve().then(()=>require("./search-provider-browser-uDZrkDBZ.cjs"));customElements.define("sfx-search-provider-browser",c)}}else if(!customElements.get("sfx-provider-browser")){const{SfxProviderBrowser:c}=await Promise.resolve().then(()=>require("./provider-browser-D7G2wcFH.cjs"));customElements.define("sfx-provider-browser",c)}this._activeConnector=t}},this._onUrlSubmit=e=>{var u,f,h;this._showUrlDialog=!1;const{url:t,name:r}=e.detail,i=(u=this.config)==null?void 0:u.callbacks,s=qe(r),o=s.startsWith("image/"),l=this._store.getState(),c=te({name:r,size:0,type:s},l.restrictions,l.files);if(c){const g={id:R(),status:"rejected",file:null,remoteUrl:t,name:r,size:0,type:s,previewUrl:null,progress:0,speed:0,bytesUploaded:0,error:c,retryCount:0,response:null,addedAt:Date.now(),meta:{},tags:[],remoteInfo:null};L(this._store,g),this._dispatchPublic(x.FILE_REJECTED,{file:g,reason:c}),(f=i==null?void 0:i.onFileRejected)==null||f.call(i,g,c);return}const d={id:R(),status:"idle",file:null,remoteUrl:t,name:r,size:0,type:s,previewUrl:o?t:null,progress:0,speed:0,bytesUploaded:0,error:null,retryCount:0,response:null,addedAt:Date.now(),meta:{},tags:[],remoteInfo:null};L(this._store,d),this._dispatchPublic(x.FILE_ADDED,{file:d}),(h=i==null?void 0:i.onFileAdded)==null||h.call(i,d),this._store.getState().queueConfig.autoProceed&&this.upload()},this._onUrlCancel=()=>{this._showUrlDialog=!1},this._onCameraCapture=e=>{this._showCameraDialog=!1,this._processIncomingFiles([e.detail.file])},this._onCameraCancel=()=>{this._showCameraDialog=!1},this._onScreenCastCapture=e=>{this._showScreenCastDialog=!1,this._processIncomingFiles([e.detail.file])},this._onScreenCastCancel=()=>{this._showScreenCastDialog=!1},this._onFileRemove=e=>{this._removeFile(e.detail.fileId)},this._onFilePreview=e=>{var r,i,s;const t=this._store.getState().files.get(e.detail.fileId);t&&(this._previewFileId=t.id,this._dispatchPublic(x.FILE_PREVIEW,{file:t}),(s=(i=(r=this.config)==null?void 0:r.callbacks)==null?void 0:i.onFilePreview)==null||s.call(i,t))},this._onFillMetadata=()=>{var t,r,i;const e=[...this._store.getState().files.values()].filter(s=>w._MODIFIABLE_STATUSES.has(s.status));this._dispatchPublic(x.FILL_METADATA,{files:e}),(i=(r=(t=this.config)==null?void 0:t.callbacks)==null?void 0:r.onFillMetadata)==null||i.call(r,e)},this._onFileRetry=e=>{var t;this._ensureEngine(),(t=this._engine)==null||t.retryFile(e.detail.fileId)},this._onRetryAll=()=>{var e;this._ensureEngine(),(e=this._engine)==null||e.retryAll()},this._onClearAll=()=>{var r,i,s;const e=(r=this.config)==null?void 0:r.callbacks;(i=this._engine)==null||i.cancelAll();const t=[...this._store.getState().files.values()];for(const o of t)o.previewUrl&&URL.revokeObjectURL(o.previewUrl),this._dispatchPublic(x.FILE_REMOVED,{file:o}),(s=e==null?void 0:e.onFileRemoved)==null||s.call(e,o);for(const o of this._rejectedTimers.values())clearTimeout(o);this._rejectedTimers.clear(),this._dimCache.clear(),this._store.setState({files:new Map,isUploading:!1,totalProgress:0,totalSpeed:0,totalBytesUploaded:0,totalBytes:0})},this._onAddMore=()=>{const e=this.shadowRoot.querySelector("sfx-drop-zone");e==null||e.browse()},this._onUploadStart=()=>{var e;if(this._phase==="complete"){((e=this.config)==null?void 0:e.clearOnComplete)!==!1&&this._onClearAll();return}this.upload()},this._onUploadMore=()=>{this._onClearAll()},this._onConnectorFilesSelected=e=>{var r,i,s;const t=(r=this.config)==null?void 0:r.callbacks;for(const o of e.detail.files){const l=this._store.getState(),c=te({name:o.name,size:o.size,type:o.mimeType},l.restrictions,l.files);if(c){const u={id:R(),status:"rejected",file:null,remoteUrl:null,name:o.name,size:o.size,type:o.mimeType,previewUrl:o.thumbnail,progress:0,speed:0,bytesUploaded:0,error:c,retryCount:0,response:null,addedAt:Date.now(),meta:{},tags:[],remoteInfo:o};L(this._store,u),this._dispatchPublic(x.FILE_REJECTED,{file:u,reason:c}),(i=t==null?void 0:t.onFileRejected)==null||i.call(t,u,c);continue}const d={id:R(),status:"idle",file:null,remoteUrl:null,name:o.name,size:o.size,type:o.mimeType,previewUrl:o.thumbnail,progress:0,speed:0,bytesUploaded:0,error:null,retryCount:0,response:null,addedAt:Date.now(),meta:{},tags:[],remoteInfo:o};L(this._store,d),this._dispatchPublic(x.FILE_ADDED,{file:d}),(s=t==null?void 0:t.onFileAdded)==null||s.call(t,d)}this._activeConnector=null,this._store.getState().queueConfig.autoProceed&&this.upload()},this._onConnectorClose=()=>{this._activeConnector=null},this._onConnectorBackdropClick=e=>{e.target===e.currentTarget&&(this._activeConnector=null)},this._onPrimaryAction=()=>{var e,t;this._dispatchPublic(x.COMPLETE_ACTION,{}),((e=this.config)==null?void 0:e.mode)==="modal"?this.close():((t=this.config)==null?void 0:t.clearOnComplete)!==!1&&this._onClearAll()},this._onInlineDismiss=()=>{var e,t,r;(r=(t=(e=this.config)==null?void 0:e.callbacks)==null?void 0:t.onCancel)==null||r.call(t),this._dispatchPublic(x.CANCEL,{})},this._onModalDismiss=()=>{var e,t,r;(r=(t=(e=this.config)==null?void 0:e.callbacks)==null?void 0:t.onCancel)==null||r.call(t),this._dispatchPublic(x.CANCEL,{}),this.close()},this._onModalBackdropClick=e=>{e.target===e.currentTarget&&this._onModalDismiss()},this._onBodyDragEnter=e=>{e.preventDefault(),this._bodyDragCounter++,this._bodyDragCounter===1&&(this._bodyDragOver=!0)},this._onBodyDragOver=e=>{e.preventDefault()},this._onBodyDragLeave=e=>{e.preventDefault(),this._bodyDragCounter--,this._bodyDragCounter<=0&&(this._bodyDragCounter=0,this._bodyDragOver=!1)},this._onBodyDrop=e=>{var r;e.preventDefault(),this._bodyDragCounter=0,this._bodyDragOver=!1;const t=Array.from(((r=e.dataTransfer)==null?void 0:r.files)??[]);t.length>0&&this._onFilesSelected(new CustomEvent("files-selected",{detail:{files:t}}))},this._onKeyDown=e=>{var t,r;if(e.key==="Escape"){if(this._fullscreenPreviewUrl){this._onFsClose();return}this._isOpen&&((t=this.config)==null?void 0:t.mode)==="modal"&&(((r=this.config)==null?void 0:r.headerButton)??"close")!=="none"&&this._onModalDismiss()}},this._dimCache=new Map,this._onFsToggleZoom=e=>{e==null||e.stopPropagation(),this._fullscreenZoomed=!this._fullscreenZoomed,this._fullscreenZoomed||(this._fsPanX=0,this._fsPanY=0)},this._onFsOverlayClick=e=>{this._fsDragDidMove||this._onFsToggleZoom(e)},this._fsDragDidMove=!1,this._onFsPanStart=e=>{this._fullscreenZoomed&&(this._fsDragging=!0,this._fsDragDidMove=!1,this._fsDragStartX=e.clientX,this._fsDragStartY=e.clientY,this._fsPanStartX=this._fsPanX,this._fsPanStartY=this._fsPanY,e.preventDefault())},this._onFsPanMove=e=>{if(!this._fsDragging)return;const t=e.clientX-this._fsDragStartX,r=e.clientY-this._fsDragStartY;(Math.abs(t)>3||Math.abs(r)>3)&&(this._fsDragDidMove=!0),this._fsPanX=this._fsPanStartX+t,this._fsPanY=this._fsPanStartY+r,this.requestUpdate()},this._onFsPanEnd=()=>{this._fsDragging=!1,requestAnimationFrame(()=>{this._fsDragDidMove=!1})},this._onFsTouchStart=e=>{if(!this._fullscreenZoomed||e.touches.length!==1)return;const t=e.touches[0];this._fsDragging=!0,this._fsDragDidMove=!1,this._fsDragStartX=t.clientX,this._fsDragStartY=t.clientY,this._fsPanStartX=this._fsPanX,this._fsPanStartY=this._fsPanY},this._onFsTouchMove=e=>{if(!this._fsDragging||e.touches.length!==1)return;const t=e.touches[0],r=t.clientX-this._fsDragStartX,i=t.clientY-this._fsDragStartY;(Math.abs(r)>3||Math.abs(i)>3)&&(this._fsDragDidMove=!0),this._fsPanX=this._fsPanStartX+r,this._fsPanY=this._fsPanStartY+i,this.requestUpdate(),e.preventDefault()},this._onFsClose=e=>{e==null||e.stopPropagation(),this._fullscreenPreviewUrl=null,this._fullscreenZoomed=!1,this._fsPanX=0,this._fsPanY=0},this._store=_e(),this._storeCtrl=new Ee(this,this._store)}open(){var e,t,r;this._isOpen||(this._isOpen=!0,(r=(t=(e=this.config)==null?void 0:e.callbacks)==null?void 0:t.onOpen)==null||r.call(t),this._dispatchPublic(x.OPEN,{}),this.requestUpdate())}close(){var e,t,r,i;this._isOpen&&(this._isOpen=!1,((e=this.config)==null?void 0:e.clearOnClose)!==!1&&this._onClearAll(),this._previewFileId=null,(i=(r=(t=this.config)==null?void 0:t.callbacks)==null?void 0:r.onClose)==null||i.call(r),this._dispatchPublic(x.CLOSE,{}),this.requestUpdate())}upload(){var i,s,o,l,c;if(this._ensureEngine(),!this._engine){console.warn("[sfx-uploader] Cannot upload: auth not resolved yet");return}const e=[...this._store.getState().files.values()].filter(d=>d.status==="idle"||d.status==="queued");if((s=(i=this.config)==null?void 0:i.callbacks)!=null&&s.onBeforeUpload&&this.config.callbacks.onBeforeUpload(e)===!1)return;const t=new CustomEvent(x.BEFORE_UPLOAD,{bubbles:!0,composed:!0,cancelable:!0,detail:{files:e}});this.dispatchEvent(t)&&(this._dispatchPublic(x.UPLOAD_STARTED,{files:e}),(c=(l=(o=this.config)==null?void 0:o.callbacks)==null?void 0:l.onUploadStarted)==null||c.call(l,e),this._engine.uploadAll())}addFiles(e){this._processIncomingFiles(e)}resumeUpload(e){var t;if(e&&e.length>0){const r=this._store.getState().files,i=new Map(r);let s=!1;for(const o of e){const l=r.get(o.id);l&&(i.set(o.id,{...l,...o}),s=!0)}s&&this._store.setState({files:i})}this._ensureEngine(),(t=this._engine)==null||t.uploadAll()}cancelUpload(){var e;(e=this._engine)==null||e.cancelAll()}getFiles(){return[...this._store.getState().files.values()]}getFile(e){return this._store.getState().files.get(e)}updateFileMeta(e,t,r){const i=this._store.getState().files,s=i.get(e);if(!s||!w._MODIFIABLE_STATUSES.has(s.status))return;const o=new Map(i);o.set(e,{...s,meta:t!=null?{...s.meta,...t}:s.meta,tags:r??s.tags}),this._store.setState({files:o})}updateFilesMeta(e){const t=this._store.getState().files,r=new Map(t);let i=!1;for(const{fileId:s,meta:o,tags:l}of e){const c=t.get(s);!c||!w._MODIFIABLE_STATUSES.has(c.status)||(r.set(s,{...c,meta:o!=null?{...c.meta,...o}:c.meta,tags:l??c.tags}),i=!0)}i&&this._store.setState({files:r})}updated(e){if(e.has("config")&&this.config&&this._applyConfig(this.config),e.has("_previewFileId")&&this._previewFileId){const t=this._store.getState().files.get(this._previewFileId);t?this._getImageDimensions(t).then(r=>{this._previewDims=r?`${r.w} × ${r.h}`:"—"}):this._previewDims="—"}}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this._onKeyDown),this._prevStoreState=this._store.getState(),this._unsubStoreEvents=this._store.subscribe(()=>this._onStoreChange())}disconnectedCallback(){var e,t;super.disconnectedCallback(),document.removeEventListener("keydown",this._onKeyDown),(e=this._unsubStoreEvents)==null||e.call(this),this._unsubStoreEvents=null,this._prevStoreState=null;for(const r of this._rejectedTimers.values())clearTimeout(r);this._rejectedTimers.clear();for(const r of this._store.getState().files.values())r.previewUrl&&URL.revokeObjectURL(r.previewUrl);(t=this._engine)==null||t.destroy(),this._engine=null}_applyConfig(e){const t={};if(e.targetFolder&&(t.targetFolder=e.targetFolder),e.restrictions&&(t.restrictions={...this._store.getState().restrictions,...e.restrictions}),e.concurrency!=null){const r=this._store.getState().queueConfig;t.queueConfig={...r,concurrency:e.concurrency}}if(e.autoProceed!=null){const r=t.queueConfig??this._store.getState().queueConfig;t.queueConfig={...r,autoProceed:e.autoProceed}}Object.keys(t).length>0&&this._store.setState(t),this._resolveAuthAndEngine(e),(e.mode==="inline"||!e.mode)&&(this._isOpen=!0)}async _resolveAuthAndEngine(e){var i,s;const t=e.auth;if(t.mode==="sass-key"||t.mode==="session"){this._apiBase=Z(t.container),this._authHeaders=N(t),this._ensureEngine(),(i=this._engine)==null||i.updateConfig({apiBase:this._apiBase,authHeaders:this._authHeaders});return}const r=++this._authResolveId;try{const o=await $e(t);if(r!==this._authResolveId)return;this._apiBase=o.apiBase,this._authHeaders=o.headers,this._ensureEngine(),(s=this._engine)==null||s.updateConfig({apiBase:this._apiBase,authHeaders:this._authHeaders})}catch(o){if(r!==this._authResolveId)return;console.error("[sfx-uploader] Auth resolution failed:",o)}}_ensureEngine(){!this._engine&&this._apiBase&&this._authHeaders&&(this._engine=new ke(this._store,{apiBase:this._apiBase,authHeaders:this._authHeaders}),this._engine.start())}_dispatchPublic(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}_onStoreChange(){var i,s,o,l,c,d,u;const e=this._store.getState(),t=this._prevStoreState;if(this._prevStoreState=e,!t)return;const r=(i=this.config)==null?void 0:i.callbacks;for(const[f,h]of e.files){const g=t.files.get(f);if(g){if(g.status!==h.status)switch(h.status){case"uploading":break;case"complete":h.response&&(this._dispatchPublic(x.UPLOAD_COMPLETE,{file:h,response:h.response}),(s=r==null?void 0:r.onUploadComplete)==null||s.call(r,h,h.response));break;case"error":case"failed":{const m=new Error(h.error??"Upload failed");this._dispatchPublic(x.UPLOAD_ERROR,{file:h,error:m}),(o=r==null?void 0:r.onUploadError)==null||o.call(r,h,m);break}case"retrying":this._dispatchPublic(x.UPLOAD_RETRY,{file:h,attempt:h.retryCount}),(l=r==null?void 0:r.onUploadRetry)==null||l.call(r,h,h.retryCount);break}h.status==="uploading"&&g.progress!==h.progress&&(this._dispatchPublic(x.UPLOAD_PROGRESS,{file:h,progress:h.progress,speed:h.speed}),(c=r==null?void 0:r.onUploadProgress)==null||c.call(r,h,h.progress,h.speed))}}if(e.totalProgress!==t.totalProgress||e.totalSpeed!==t.totalSpeed){const f=e.totalSpeed>0?(e.totalBytes-e.totalBytesUploaded)/e.totalSpeed:0;this._dispatchPublic(x.TOTAL_PROGRESS,{percentage:e.totalProgress,speed:e.totalSpeed,eta:f}),(d=r==null?void 0:r.onTotalProgress)==null||d.call(r,e.totalProgress,e.totalSpeed,f)}if(t.isUploading&&!e.isUploading){const f=[...e.files.values()];if(!f.some(g=>g.status==="cancelled")){const g=f.filter(v=>v.status==="complete"),m=f.filter(v=>v.status==="failed"||v.status==="error");this._dispatchPublic(x.ALL_COMPLETE,{successful:g,failed:m}),(u=r==null?void 0:r.onAllComplete)==null||u.call(r,g,m)}}}get _mergedSources(){var c;const e=(c=this.config)==null?void 0:c.connectors;if(e===this._cachedSourcesConfig)return this._cachedSources;if(this._cachedSourcesConfig=e,!e)return this._cachedSources=M,this._cachedSources;const t=e.providers.length>0?Se(e.providers):[],r=e.customSources??[],i=M.filter(d=>d.id==="device"||d.id==="url"),s=M.filter(d=>d.id!=="device"&&d.id!=="url"),o=new Set,l=[];for(const d of[...i,...t,...s,...r])if(!o.has(d.id)){if(w._RESERVED_IDS.has(d.id)&&d.onActivate){console.warn(`[sfx-uploader] Custom source id "${d.id}" conflicts with a built-in source and was skipped.`);continue}o.add(d.id),l.push(d)}return this._cachedSources=l,this._cachedSources}get _phase(){const e=this._storeCtrl.state,t=[...e.files.values()];if(t.length===0)return"empty";if(e.isUploading)return"uploading";const r=new Set(["complete","rejected","cancelled","failed"]);return t.every(i=>r.has(i.status))&&t.some(i=>i.status==="complete")?"complete":"ready"}_processIncomingFiles(e){var r,i,s,o;const t=(r=this.config)==null?void 0:r.callbacks;for(const l of e){const c=this._store.getState(),d=Ne(l,c.restrictions,c.files);if(d){const h={id:R(),status:"rejected",file:l,remoteUrl:null,name:l.name,size:l.size,type:l.type,previewUrl:null,progress:0,speed:0,bytesUploaded:0,error:d,retryCount:0,response:null,addedAt:Date.now(),meta:{},tags:[],remoteInfo:null};L(this._store,h),this._dispatchPublic(x.FILE_REJECTED,{file:h,reason:d}),(i=t==null?void 0:t.onFileRejected)==null||i.call(t,h,d);const g=(s=this.config)==null?void 0:s.rejectedFileAutoRemoveDelay,m=g===!1||g===0?0:g??4e3;if(m>0){const v=h.id,T=setTimeout(()=>{this._rejectedTimers.delete(v);const y=this._store.getState().files.get(v);y&&y.status==="rejected"&&ge(this._store,v)},m);this._rejectedTimers.set(v,T)}continue}let u=null;l.type.startsWith("image/")&&(u=URL.createObjectURL(l));const f={id:R(),status:"idle",file:l,remoteUrl:null,name:l.name,size:l.size,type:l.type,previewUrl:u,progress:0,speed:0,bytesUploaded:0,error:null,retryCount:0,response:null,addedAt:Date.now(),meta:{},tags:[],remoteInfo:null};L(this._store,f),this._dispatchPublic(x.FILE_ADDED,{file:f}),(o=t==null?void 0:t.onFileAdded)==null||o.call(t,f),l.type.startsWith("video/")&&Ye(l).then(h=>{if(!h)return;const g=this._store.getState(),m=g.files.get(f.id);if(m){const v=new Map(g.files);v.set(f.id,{...m,previewUrl:h}),this._store.setState({files:v})}else URL.revokeObjectURL(h)})}this._store.getState().queueConfig.autoProceed&&this.upload()}_removeFile(e){var i,s,o,l;const t=this._store.getState().files.get(e);if(!t)return;const r={...t};t.previewUrl&&URL.revokeObjectURL(t.previewUrl),(t.status==="uploading"||t.status==="queued"||t.status==="retrying")&&((i=this._engine)==null||i.cancelFile(e)),ge(this._store,e),this._dimCache.delete(e),this._dispatchPublic(x.FILE_REMOVED,{file:r}),(l=(o=(s=this.config)==null?void 0:s.callbacks)==null?void 0:o.onFileRemoved)==null||l.call(o,r)}render(){var t;return(((t=this.config)==null?void 0:t.mode)??"modal")==="modal"?this._isOpen?n.html`
2423
+ <div class="modal-backdrop" @click=${this._onModalBackdropClick}>
2424
+ <div class="modal-card">
2425
+ ${this._renderHeader()}
2426
+ ${this._renderBody()}
2427
+ </div>
2428
+ </div>
2429
+ `:n.nothing:n.html`
2430
+ <div class="inline">
2431
+ ${this._renderHeader()}
2432
+ ${this._renderBody()}
2433
+ </div>
2434
+ `}_renderHeader(){var l,c;const e=((l=this.config)==null?void 0:l.mode)??"modal",t=((c=this.config)==null?void 0:c.headerButton)??(e==="modal"?"close":"none"),r=this._phase==="complete",i=e==="modal"?this._onModalDismiss:this._onInlineDismiss,s=t==="back"?n.html`<button class="header-btn header-btn-back" aria-label="Back to Asset Picker" @click=${i}>
2435
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2436
+ <polyline points="15 18 9 12 15 6"/>
2437
+ </svg>
2438
+ </button>`:n.nothing,o=t==="close"?n.html`<button class="header-btn header-btn-close" aria-label="Close" @click=${i}>
2439
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
2440
+ <line x1="18" y1="6" x2="6" y2="18" />
2441
+ <line x1="6" y1="6" x2="18" y2="18" />
2442
+ </svg>
2443
+ </button>`:n.nothing;return n.html`
2444
+ <div class="header">
2445
+ ${s}
2446
+ <div class="header-icon ${r?"header-icon-done":""}">
2447
+ ${r?n.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
2448
+ <polyline points="20 6 9 17 4 12" />
2449
+ </svg>`:n.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round">
2450
+ <polyline points="16 16 12 12 8 16" />
2451
+ <line x1="12" y1="12" x2="12" y2="21" />
2452
+ <path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3" />
2453
+ </svg>`}
2454
+ </div>
2455
+ <div class="header-title">${r?"Upload Complete":"Upload Files"}</div>
2456
+ ${o}
2457
+ </div>
2458
+ `}_getImageDimensions(e){return e.previewUrl?this._dimCache.has(e.id)?Promise.resolve(this._dimCache.get(e.id)):new Promise(t=>{const r=new Image;r.onload=()=>{const i={w:r.naturalWidth,h:r.naturalHeight};this._dimCache.set(e.id,i),t(i)},r.onerror=()=>{this._dimCache.set(e.id,null),t(null)},r.src=e.previewUrl}):Promise.resolve(null)}_renderPreviewLayout(e){var s;if(e.length===0)return n.nothing;const t=e.find(o=>o.id===this._previewFileId)??e[0],r=((s=t.name.split(".").pop())==null?void 0:s.toUpperCase())||"",i=new Date(t.addedAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return n.html`
2459
+ <div class="preview-topbar">
2460
+ <div class="asset-count" style="padding:0">${e.length} ${e.length===1?"asset":"assets"}</div>
2461
+ <div class="preview-panel-header">
2462
+ <button @click=${()=>this._onFileRemoveById(t.id)} title="Delete">
2463
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2464
+ <polyline points="3 6 5 6 21 6" />
2465
+ <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" />
2466
+ <path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
2467
+ <line x1="10" y1="11" x2="10" y2="17" />
2468
+ <line x1="14" y1="11" x2="14" y2="17" />
2469
+ </svg>
2470
+ </button>
2471
+ <button @click=${()=>{t.previewUrl&&(this._fullscreenPreviewUrl=t.previewUrl,this._fullscreenZoomed=!1)}} title="Fullscreen">
2472
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2473
+ <polyline points="15 3 21 3 21 9" />
2474
+ <polyline points="9 21 3 21 3 15" />
2475
+ <line x1="21" y1="3" x2="14" y2="10" />
2476
+ <line x1="3" y1="21" x2="10" y2="14" />
2477
+ </svg>
2478
+ </button>
2479
+ <button @click=${()=>{this._previewFileId=null}} title="Close">
2480
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
2481
+ <line x1="18" y1="6" x2="6" y2="18" />
2482
+ <line x1="6" y1="6" x2="18" y2="18" />
2483
+ </svg>
2484
+ </button>
2485
+ </div>
2486
+ </div>
2487
+ <div class="preview-layout">
2488
+ <div class="file-grid-side">
2489
+ <sfx-file-list .files=${e}></sfx-file-list>
2490
+ </div>
2491
+ <div class="preview-panel">
2492
+ ${t.previewUrl?n.html`
2493
+ <div class="preview-img-wrap">
2494
+ <img class="preview-image" src=${t.previewUrl} alt=${t.name} />
2495
+ <button class="preview-nav prev" ?disabled=${e.indexOf(t)===0} @click=${()=>this._navigatePreview(e,-1)}>
2496
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="15 18 9 12 15 6"/></svg>
2497
+ </button>
2498
+ <button class="preview-nav next" ?disabled=${e.indexOf(t)===e.length-1} @click=${()=>this._navigatePreview(e,1)}>
2499
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="9 6 15 12 9 18"/></svg>
2500
+ </button>
2501
+ </div>
2502
+ `:n.nothing}
2503
+ <div class="preview-meta-list">
2504
+ <div class="preview-meta-row">
2505
+ <span class="preview-meta-label">Type</span>
2506
+ <span class="preview-meta-value">${r}</span>
2507
+ </div>
2508
+ <div class="preview-meta-row">
2509
+ <span class="preview-meta-label">Size</span>
2510
+ <span class="preview-meta-value">${V(t.size)}</span>
2511
+ </div>
2512
+ <div class="preview-meta-row">
2513
+ <span class="preview-meta-label">Dimensions</span>
2514
+ <span class="preview-meta-value">${this._previewDims}</span>
2515
+ </div>
2516
+ <div class="preview-meta-row">
2517
+ <span class="preview-meta-label">Name</span>
2518
+ <span class="preview-meta-value">${t.name}</span>
2519
+ </div>
2520
+ <div class="preview-meta-row">
2521
+ <span class="preview-meta-label">Added</span>
2522
+ <span class="preview-meta-value">${i}</span>
2523
+ </div>
2524
+ </div>
2525
+ </div>
2526
+ </div>
2527
+ `}_navigatePreview(e,t){const i=e.findIndex(s=>s.id===this._previewFileId)+t;i>=0&&i<e.length&&(this._previewFileId=e[i].id)}_onFileRemoveById(e){this._removeFile(e);const t=[...this._store.getState().files.values()];t.length===0?this._previewFileId=null:this._previewFileId===e&&(this._previewFileId=t[0].id)}_renderBody(){var o,l,c;const e=this._storeCtrl.state,t=[...e.files.values()],r=this._phase,i=Ve(e.restrictions),s=t.length>0;return n.html`
2528
+ <div class="content"
2529
+ @files-selected=${this._onFilesSelected}
2530
+ @source-click=${this._onSourceClick}
2531
+ @file-remove=${this._onFileRemove}
2532
+ @file-preview=${this._onFilePreview}
2533
+ @file-retry=${this._onFileRetry}
2534
+ @fill-metadata=${this._onFillMetadata}
2535
+ @retry-all=${this._onRetryAll}
2536
+ @clear-all=${this._onClearAll}
2537
+ @add-more=${this._onAddMore}
2538
+ @upload-start=${this._onUploadStart}
2539
+ @upload-more=${this._onUploadMore}
2540
+ @primary-action=${this._onPrimaryAction}
2541
+ @connector-files-selected=${this._onConnectorFilesSelected}
2542
+ @connector-close=${this._onConnectorClose}
2543
+ @url-submit=${this._onUrlSubmit}
2544
+ @url-cancel=${this._onUrlCancel}
2545
+ @camera-capture=${this._onCameraCapture}
2546
+ @camera-cancel=${this._onCameraCancel}
2547
+ @screencast-capture=${this._onScreenCastCapture}
2548
+ @screencast-cancel=${this._onScreenCastCancel}
2549
+ >
2550
+ <div
2551
+ class="body ${s?"has-files":""} ${this._bodyDragOver?"body-drag-over":""}"
2552
+ @dragenter=${s?this._onBodyDragEnter:n.nothing}
2553
+ @dragover=${s?this._onBodyDragOver:n.nothing}
2554
+ @dragleave=${s?this._onBodyDragLeave:n.nothing}
2555
+ @drop=${s?this._onBodyDrop:n.nothing}
2556
+ >
2557
+ ${r==="complete"?n.html`
2558
+ <sfx-success-card
2559
+ .fileCount=${t.filter(d=>d.status==="complete").length}
2560
+ .totalSize=${t.filter(d=>d.status==="complete").reduce((d,u)=>d+(u.size||0),0)}
2561
+ .thumbnails=${t.filter(d=>d.status==="complete"&&d.previewUrl).map(d=>d.previewUrl)}
2562
+ ></sfx-success-card>
2563
+ `:n.html`
2564
+ <sfx-drop-zone
2565
+ .compact=${s}
2566
+ .externalDragOver=${this._bodyDragOver}
2567
+ .accept=${i}
2568
+ .sources=${this._mergedSources}
2569
+ .sourcesLayout=${((o=this.config)==null?void 0:o.sourcesLayout)??"pills"}
2570
+ ></sfx-drop-zone>
2571
+
2572
+ ${s?this._previewFileId?this._renderPreviewLayout(t):n.html`
2573
+ <div class="asset-count">${t.length} ${t.length===1?"file":"files"} · ${V(t.reduce((d,u)=>d+(u.size||0),0))}</div>
2574
+ <sfx-file-list .files=${t}></sfx-file-list>
2575
+ `:n.nothing}
2576
+ `}
2577
+ </div>
2578
+
2579
+ ${s&&r!=="complete"?n.html`
2580
+ <sfx-actions-bar
2581
+ .uploadState=${r==="uploading"?"uploading":"idle"}
2582
+ .fileCount=${t.length}
2583
+ .totalSize=${t.reduce((d,u)=>d+(u.size||0),0)}
2584
+ .failedCount=${t.filter(d=>d.status==="failed"||d.status==="error").length}
2585
+ .completedCount=${t.filter(d=>d.status==="complete").length}
2586
+ .uploadProgress=${e.totalProgress??0}
2587
+ .showFillMetadata=${!!((l=this.config)!=null&&l.showFillMetadata)}
2588
+ ></sfx-actions-bar>
2589
+ `:n.nothing}
2590
+
2591
+ ${this._showUrlDialog?n.html`<sfx-url-dialog></sfx-url-dialog>`:n.nothing}
2592
+ ${this._showCameraDialog?n.html`<sfx-camera-dialog></sfx-camera-dialog>`:n.nothing}
2593
+ ${this._showScreenCastDialog?n.html`<sfx-screen-cast-dialog></sfx-screen-cast-dialog>`:n.nothing}
2594
+ ${this._activeConnector&&((c=this.config)!=null&&c.connectors)?n.html`
2595
+ <div class="connector-modal-backdrop" @click=${this._onConnectorBackdropClick}>
2596
+ <div class="connector-modal">
2597
+ ${ye.has(this._activeConnector)?n.html`
2598
+ <sfx-search-provider-browser
2599
+ .provider=${this._activeConnector}
2600
+ .companionUrl=${this.config.connectors.companionUrl}
2601
+ ></sfx-search-provider-browser>
2602
+ `:n.html`
2603
+ <sfx-provider-browser
2604
+ .provider=${this._activeConnector}
2605
+ .companionUrl=${this.config.connectors.companionUrl}
2606
+ ></sfx-provider-browser>
2607
+ `}
2608
+ </div>
2609
+ </div>
2610
+ `:n.nothing}
2611
+
2612
+ ${this._fullscreenPreviewUrl?n.html`
2613
+ <div
2614
+ class="fs-overlay ${this._fullscreenZoomed?"zoomed":""} ${this._fsDragging?"panning":""}"
2615
+ @click=${this._onFsOverlayClick}
2616
+ @mousedown=${this._onFsPanStart}
2617
+ @mousemove=${this._onFsPanMove}
2618
+ @mouseup=${this._onFsPanEnd}
2619
+ @mouseleave=${this._onFsPanEnd}
2620
+ @touchstart=${this._onFsTouchStart}
2621
+ @touchmove=${this._onFsTouchMove}
2622
+ @touchend=${this._onFsPanEnd}
2623
+ >
2624
+ <div class="fs-toolbar" @click=${d=>d.stopPropagation()}>
2625
+ <button class="fs-btn" @click=${this._onFsToggleZoom} title="${this._fullscreenZoomed?"Zoom out":"Zoom in"}">
2626
+ ${this._fullscreenZoomed?n.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="8" y1="11" x2="14" y2="11"/></svg>`:n.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></svg>`}
2627
+ </button>
2628
+ <button class="fs-btn" @click=${this._onFsClose} title="Close">
2629
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
2630
+ <line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
2631
+ </svg>
2632
+ </button>
2633
+ </div>
2634
+ <img
2635
+ class="fs-img"
2636
+ src=${this._fullscreenPreviewUrl}
2637
+ alt=""
2638
+ style=${this._fullscreenZoomed?`transform: scale(2) translate(${this._fsPanX}px, ${this._fsPanY}px)`:""}
2639
+ draggable="false"
2640
+ />
2641
+ <div class="fs-filename">${this._getFullscreenFilename()}</div>
2642
+ </div>
2643
+ `:n.nothing}
2644
+ </div>
2645
+ `}_getFullscreenFilename(){if(!this._previewFileId)return"";const e=this._store.getState().files.get(this._previewFileId);return(e==null?void 0:e.name)??""}},w.styles=n.css`
2646
+ :host {
2647
+ display: block;
2648
+ font-family: var(--sfx-up-font, 'Inter', system-ui, -apple-system, sans-serif);
2649
+ color: var(--sfx-up-text, #1e293b);
2650
+ /* Bridge to Scaleflex design system with standalone fallbacks */
2651
+ --sfx-up-primary: var(--primary, #2563eb);
2652
+ --sfx-up-primary-hover: var(--primary-hover, #1d4ed8);
2653
+ --sfx-up-primary-mid: var(--primary-mid, #3b82f6);
2654
+ --sfx-up-primary-bg: var(--accent, #eff6ff);
2655
+ --sfx-up-primary-glow: rgba(37, 99, 235, 0.18);
2656
+ --sfx-up-success: var(--success, #16a34a);
2657
+ --sfx-up-error: var(--destructive, #dc2626);
2658
+ --sfx-up-text: var(--foreground, #1e293b);
2659
+ --sfx-up-text-secondary: var(--secondary-foreground, #475569);
2660
+ --sfx-up-text-muted: var(--muted-foreground, #94a3b8);
2661
+ --sfx-up-border: var(--border, #e8edf5);
2662
+ --sfx-up-border-light: var(--muted, #f1f5f9);
2663
+ --sfx-up-bg: var(--background, #ffffff);
2664
+ --sfx-up-radius: 16px;
2665
+ --sfx-up-font: 'Inter', system-ui, -apple-system, sans-serif;
2666
+ --sfx-up-shadow: var(--shadow, rgba(0, 0, 0, 0.1));
2667
+ --sfx-up-surface: var(--card, #f8fafc);
2668
+ --sfx-up-backdrop: rgba(0, 0, 0, 0.45);
2669
+ --sfx-up-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
2670
+ --sfx-up-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
2671
+ --sfx-up-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06);
2672
+ --sfx-up-ring: var(--ring, oklch(0.578 0.198 268.129 / 0.7));
2673
+ --sfx-up-max-height: 88vh;
2674
+ }
2675
+
2676
+ /* --- Modal overlay --- */
2677
+ .modal-backdrop {
2678
+ position: fixed;
2679
+ inset: 0;
2680
+ background: var(--sfx-up-backdrop);
2681
+ backdrop-filter: blur(6px);
2682
+ display: flex;
2683
+ align-items: center;
2684
+ justify-content: center;
2685
+ z-index: 9999;
2686
+ padding: 24px;
2687
+ animation: fadeIn 0.2s ease;
2688
+ }
2689
+
2690
+ .modal-card {
2691
+ background: var(--sfx-up-bg, #fff);
2692
+ border-radius: 16px;
2693
+ box-shadow: 0 28px 80px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.06);
2694
+ width: 100%;
2695
+ max-width: 912px;
2696
+ max-height: var(--sfx-up-max-height, 88vh);
2697
+ display: flex;
2698
+ flex-direction: column;
2699
+ overflow: hidden;
2700
+ position: relative;
2701
+ animation: modalIn 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
2702
+ }
2703
+
2704
+ /* --- Header --- */
2705
+ .header {
2706
+ display: flex;
2707
+ align-items: center;
2708
+ padding: 16px 24px;
2709
+ background: var(--sfx-up-bg, #fff);
2710
+ border-bottom: 1px solid var(--sfx-up-border, #e2e8f0);
2711
+ flex-shrink: 0;
2712
+ }
2713
+
2714
+ .header-icon {
2715
+ width: 32px;
2716
+ height: 32px;
2717
+ border-radius: 8px;
2718
+ background: var(--sfx-up-primary-bg, #eff6ff);
2719
+ color: var(--sfx-up-primary, #2563eb);
2720
+ display: flex;
2721
+ align-items: center;
2722
+ justify-content: center;
2723
+ margin-right: 12px;
2724
+ flex-shrink: 0;
2725
+ }
2726
+
2727
+ .header-icon-done {
2728
+ background: var(--sfx-up-primary-bg, #eff6ff);
2729
+ color: var(--sfx-up-primary, #2563eb);
2730
+ }
2731
+
2732
+ .header-icon svg {
2733
+ width: 16px;
2734
+ height: 16px;
2735
+ }
2736
+
2737
+ .header-title {
2738
+ font-size: 16px;
2739
+ font-weight: 700;
2740
+ color: var(--sfx-up-text, #111827);
2741
+ flex: 1;
2742
+ }
2743
+
2744
+ .header-btn {
2745
+ width: 30px;
2746
+ height: 30px;
2747
+ border-radius: 8px;
2748
+ border: none;
2749
+ background: var(--sfx-up-surface, #f8fafc);
2750
+ color: var(--sfx-up-text-muted, #94a3b8);
2751
+ cursor: pointer;
2752
+ display: flex;
2753
+ align-items: center;
2754
+ justify-content: center;
2755
+ transition: background 0.15s, color 0.15s;
2756
+ flex-shrink: 0;
2757
+ }
2758
+
2759
+ .header-btn svg {
2760
+ width: 16px;
2761
+ height: 16px;
2762
+ }
2763
+
2764
+ .header-btn:hover {
2765
+ background: var(--sfx-up-border, #e2e8f0);
2766
+ color: var(--sfx-up-text, #1e293b);
2767
+ }
2768
+
2769
+ .header-btn:focus-visible {
2770
+ outline: 2px solid var(--sfx-up-ring, oklch(0.578 0.198 268.129 / 0.7));
2771
+ outline-offset: 2px;
2772
+ }
2773
+
2774
+ .header-btn-back {
2775
+ margin-right: 12px;
2776
+ background: var(--sfx-up-primary-bg, #eff6ff);
2777
+ color: var(--sfx-up-primary, #2563eb);
2778
+ width: 32px;
2779
+ height: 32px;
2780
+ position: relative;
2781
+ }
2782
+
2783
+ .header-btn-back:hover {
2784
+ background: #dbeafe;
2785
+ color: var(--sfx-up-primary, #2563eb);
2786
+ box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
2787
+ }
2788
+
2789
+ .header-btn-back::after {
2790
+ content: 'Back to Asset Picker';
2791
+ position: absolute;
2792
+ left: calc(100% + 8px);
2793
+ top: 50%;
2794
+ transform: translateY(-50%);
2795
+ background: #fff;
2796
+ color: var(--sfx-up-text, #1e293b);
2797
+ font-size: 12px;
2798
+ font-weight: 500;
2799
+ white-space: nowrap;
2800
+ padding: 6px 12px;
2801
+ border-radius: 8px;
2802
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
2803
+ opacity: 0;
2804
+ pointer-events: none;
2805
+ transition: opacity 0.15s ease;
2806
+ z-index: 10;
2807
+ }
2808
+
2809
+ .header-btn-back:hover::after {
2810
+ opacity: 1;
2811
+ }
2812
+
2813
+ .header-btn-close {
2814
+ margin-left: auto;
2815
+ }
2816
+
2817
+ /* --- Responsive header buttons --- */
2818
+ @media (max-width: 768px) {
2819
+ .header-btn { width: 28px; height: 28px; }
2820
+ .header-btn svg { width: 14px; height: 14px; }
2821
+ }
2822
+ @media (max-width: 480px) {
2823
+ .header-btn { width: 26px; height: 26px; }
2824
+ }
2825
+
2826
+ /* --- Content wrapper (holds body + actions bar) --- */
2827
+ .content {
2828
+ flex: 1;
2829
+ display: flex;
2830
+ flex-direction: column;
2831
+ min-height: 0;
2832
+ }
2833
+
2834
+ /* --- Body --- */
2835
+ .body {
2836
+ flex: 1;
2837
+ overflow: hidden;
2838
+ padding: 24px;
2839
+ display: flex;
2840
+ flex-direction: column;
2841
+ align-items: stretch;
2842
+ justify-content: stretch;
2843
+ gap: 4px;
2844
+ min-height: 0;
2845
+ background: var(--sfx-up-bg, #fff);
2846
+ }
2847
+
2848
+ .body.body-drag-over {
2849
+ background: var(--sfx-up-primary-bg, #eff6ff);
2850
+ outline: 2px dashed var(--sfx-up-primary, #2563eb);
2851
+ outline-offset: -4px;
2852
+ border-radius: 8px;
2853
+ }
2854
+
2855
+ .body.has-files {
2856
+ justify-content: flex-start;
2857
+ align-items: stretch;
2858
+ overflow: hidden;
2859
+ gap: 0;
2860
+ animation: bodyReveal 0.35s ease both;
2861
+ }
2862
+
2863
+ @keyframes bodyReveal {
2864
+ from { opacity: 0.5; }
2865
+ to { opacity: 1; }
2866
+ }
2867
+
2868
+ .body.has-files::-webkit-scrollbar-thumb:hover {
2869
+ background: rgba(0, 0, 0, 0.25);
2870
+ }
2871
+
2872
+ .body sfx-drop-zone {
2873
+ position: relative;
2874
+ z-index: 1;
2875
+ overflow: visible;
2876
+ }
2877
+
2878
+ .asset-count {
2879
+ font-size: 12px;
2880
+ font-weight: 500;
2881
+ color: var(--sfx-up-text-secondary, #64748b);
2882
+ padding: 24px 0 8px;
2883
+ flex-shrink: 0;
2884
+ }
2885
+
2886
+ /* --- Inline mode --- */
2887
+ .inline {
2888
+ border: 1px solid var(--sfx-up-border, #e2e8f0);
2889
+ border-radius: var(--sfx-up-radius, 16px);
2890
+ background: var(--sfx-up-bg, #fff);
2891
+ display: flex;
2892
+ flex-direction: column;
2893
+ overflow: hidden;
2894
+ height: 100%;
2895
+ max-height: var(--sfx-up-max-height, 88vh);
2896
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
2897
+ transition: box-shadow 0.25s ease;
2898
+ animation: inlineIn 0.25s ease;
2899
+ }
2900
+
2901
+ .inline:hover {
2902
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
2903
+ }
2904
+
2905
+ /* --- Preview split layout --- */
2906
+ .preview-layout {
2907
+ display: flex;
2908
+ flex: 1;
2909
+ min-height: 0;
2910
+ overflow: hidden;
2911
+ }
2912
+
2913
+ .preview-layout .file-grid-side {
2914
+ flex: 54;
2915
+ min-width: 0;
2916
+ overflow-y: auto;
2917
+ padding-right: 12px;
2918
+ scrollbar-width: thin;
2919
+ scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
2920
+ }
2921
+
2922
+ .preview-layout .file-grid-side::-webkit-scrollbar { width: 5px; }
2923
+ .preview-layout .file-grid-side::-webkit-scrollbar-track { background: transparent; }
2924
+ .preview-layout .file-grid-side::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
2925
+
2926
+ .preview-topbar {
2927
+ display: flex;
2928
+ align-items: center;
2929
+ justify-content: space-between;
2930
+ flex-shrink: 0;
2931
+ padding: 12px 0;
2932
+ }
2933
+
2934
+ .preview-panel {
2935
+ flex: 46;
2936
+ min-width: 0;
2937
+ display: flex;
2938
+ flex-direction: column;
2939
+ overflow-y: auto;
2940
+ overflow-x: hidden;
2941
+ padding: 0 20px 20px;
2942
+ scrollbar-width: thin;
2943
+ scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
2944
+ }
2945
+
2946
+ .preview-panel::-webkit-scrollbar { width: 5px; }
2947
+ .preview-panel::-webkit-scrollbar-track { background: transparent; }
2948
+ .preview-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
2949
+
2950
+ .preview-panel-header {
2951
+ display: flex;
2952
+ align-items: center;
2953
+ justify-content: flex-end;
2954
+ gap: 8px;
2955
+ padding: 12px 0;
2956
+ flex-shrink: 0;
2957
+ }
2958
+
2959
+ .preview-panel-header button {
2960
+ width: 32px;
2961
+ height: 32px;
2962
+ border-radius: 6px;
2963
+ border: none;
2964
+ background: none;
2965
+ cursor: pointer;
2966
+ display: flex;
2967
+ align-items: center;
2968
+ justify-content: center;
2969
+ color: var(--sfx-up-text-muted, #9ca3af);
2970
+ transition: background 0.15s, color 0.15s;
2971
+ padding: 0;
2972
+ }
2973
+
2974
+ .preview-panel-header button:hover {
2975
+ background: var(--sfx-up-surface, #f8fafc);
2976
+ color: var(--sfx-up-text, #374151);
2977
+ }
2978
+
2979
+ .preview-panel-header button svg {
2980
+ width: 18px;
2981
+ height: 18px;
2982
+ }
2983
+
2984
+ .preview-img-wrap {
2985
+ position: relative;
2986
+ flex-shrink: 0;
2987
+ }
2988
+
2989
+ .preview-image {
2990
+ width: 100%;
2991
+ height: 320px;
2992
+ border-radius: 6px;
2993
+ object-fit: contain;
2994
+ display: block;
2995
+ border: 1px solid var(--sfx-up-border, #e8eaed);
2996
+ }
2997
+
2998
+ .preview-nav {
2999
+ position: absolute;
3000
+ top: 50%;
3001
+ transform: translateY(-50%);
3002
+ width: 36px;
3003
+ height: 36px;
3004
+ border-radius: 50%;
3005
+ border: none;
3006
+ background: #fff;
3007
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
3008
+ cursor: pointer;
3009
+ display: flex;
3010
+ align-items: center;
3011
+ justify-content: center;
3012
+ color: var(--sfx-up-text, #1e293b);
3013
+ transition: all 0.15s;
3014
+ z-index: 2;
3015
+ padding: 0;
3016
+ }
3017
+
3018
+ .preview-nav:hover {
3019
+ box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
3020
+ transform: translateY(-50%) scale(1.06);
3021
+ }
3022
+
3023
+ .preview-nav:active {
3024
+ transform: translateY(-50%) scale(0.96);
3025
+ }
3026
+
3027
+ .preview-nav svg {
3028
+ width: 18px;
3029
+ height: 18px;
3030
+ }
3031
+
3032
+ .preview-nav.prev { left: 10px; }
3033
+ .preview-nav.next { right: 10px; }
3034
+
3035
+ .preview-nav:disabled {
3036
+ opacity: 0.35;
3037
+ cursor: default;
3038
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
3039
+ }
3040
+
3041
+ .preview-nav:disabled:hover {
3042
+ transform: translateY(-50%);
3043
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
3044
+ }
3045
+
3046
+ .preview-meta-list {
3047
+ display: flex;
3048
+ flex-direction: column;
3049
+ margin-top: 16px;
3050
+ flex-shrink: 0;
3051
+ gap: 2px;
3052
+ }
3053
+
3054
+ .preview-meta-row {
3055
+ display: flex;
3056
+ align-items: baseline;
3057
+ padding: 7px 0;
3058
+ }
3059
+
3060
+ .preview-meta-label {
3061
+ width: 110px;
3062
+ flex-shrink: 0;
3063
+ font-size: 14px;
3064
+ font-weight: 400;
3065
+ color: var(--sfx-up-text-muted, #94a3b8);
3066
+ }
3067
+
3068
+ .preview-meta-value {
3069
+ font-size: 14px;
3070
+ font-weight: 400;
3071
+ color: var(--foreground, var(--sfx-up-text, #1e293b));
3072
+ word-break: break-all;
3073
+ }
3074
+
3075
+ /* --- Connector modal overlay --- */
3076
+ .connector-modal-backdrop {
3077
+ position: fixed;
3078
+ inset: 0;
3079
+ z-index: 1000;
3080
+ background: var(--sfx-up-backdrop);
3081
+ backdrop-filter: blur(6px);
3082
+ display: flex;
3083
+ align-items: center;
3084
+ justify-content: center;
3085
+ padding: 20px;
3086
+ animation: fadeIn 0.18s ease both;
3087
+ }
3088
+
3089
+ .connector-modal {
3090
+ background: var(--sfx-up-bg, #fff);
3091
+ border-radius: 12px;
3092
+ box-shadow: 0 28px 80px var(--sfx-up-shadow, rgba(0, 0, 0, 0.18)), 0 4px 16px oklch(0 0 0 / 0.06);
3093
+ width: 100%;
3094
+ max-width: 520px;
3095
+ height: 75vh;
3096
+ max-height: 640px;
3097
+ min-height: 400px;
3098
+ overflow: hidden;
3099
+ display: flex;
3100
+ flex-direction: column;
3101
+ animation: modalIn 0.28s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
3102
+ }
3103
+
3104
+ @keyframes fadeIn {
3105
+ from { opacity: 0; }
3106
+ to { opacity: 1; }
3107
+ }
3108
+
3109
+ @keyframes modalIn {
3110
+ from {
3111
+ opacity: 0;
3112
+ transform: scale(0.92) translateY(10px);
3113
+ }
3114
+ to {
3115
+ opacity: 1;
3116
+ transform: scale(1) translateY(0);
3117
+ }
3118
+ }
3119
+
3120
+ @keyframes inlineIn {
3121
+ from { opacity: 0; }
3122
+ to { opacity: 1; }
3123
+ }
3124
+
3125
+ /* --- Fullscreen preview overlay --- */
3126
+ .fs-overlay {
3127
+ position: fixed;
3128
+ inset: 0;
3129
+ z-index: 10000;
3130
+ background: rgba(0, 0, 0, 0.92);
3131
+ display: flex;
3132
+ align-items: center;
3133
+ justify-content: center;
3134
+ animation: fadeIn 0.2s ease;
3135
+ cursor: zoom-in;
3136
+ }
3137
+
3138
+ .fs-overlay.zoomed {
3139
+ cursor: grab;
3140
+ overflow: hidden;
3141
+ }
3142
+
3143
+ .fs-overlay.zoomed.panning {
3144
+ cursor: grabbing;
3145
+ }
3146
+
3147
+ .fs-overlay.zoomed .fs-img {
3148
+ max-width: none;
3149
+ max-height: none;
3150
+ width: auto;
3151
+ height: auto;
3152
+ }
3153
+
3154
+ .fs-img {
3155
+ max-width: 92vw;
3156
+ max-height: 88vh;
3157
+ object-fit: contain;
3158
+ border-radius: 4px;
3159
+ user-select: none;
3160
+ -webkit-user-drag: none;
3161
+ transition: transform 0.25s ease;
3162
+ }
3163
+
3164
+ .fs-overlay.panning .fs-img {
3165
+ transition: none;
3166
+ }
3167
+
3168
+ .fs-toolbar {
3169
+ position: fixed;
3170
+ top: 16px;
3171
+ right: 16px;
3172
+ display: flex;
3173
+ gap: 8px;
3174
+ z-index: 10001;
3175
+ }
3176
+
3177
+ .fs-btn {
3178
+ width: 40px;
3179
+ height: 40px;
3180
+ border-radius: 6px;
3181
+ border: none;
3182
+ background: rgba(255, 255, 255, 0.12);
3183
+ backdrop-filter: blur(8px);
3184
+ color: #fff;
3185
+ cursor: pointer;
3186
+ display: flex;
3187
+ align-items: center;
3188
+ justify-content: center;
3189
+ transition: background 0.15s;
3190
+ }
3191
+
3192
+ .fs-btn:hover {
3193
+ background: rgba(255, 255, 255, 0.25);
3194
+ }
3195
+
3196
+ .fs-btn svg {
3197
+ width: 20px;
3198
+ height: 20px;
3199
+ }
3200
+
3201
+ .fs-filename {
3202
+ position: fixed;
3203
+ bottom: 20px;
3204
+ left: 50%;
3205
+ transform: translateX(-50%);
3206
+ color: rgba(255, 255, 255, 0.7);
3207
+ font-size: 13px;
3208
+ font-weight: 500;
3209
+ background: rgba(0, 0, 0, 0.4);
3210
+ backdrop-filter: blur(8px);
3211
+ padding: 6px 16px;
3212
+ border-radius: 8px;
3213
+ white-space: nowrap;
3214
+ z-index: 10001;
3215
+ }
3216
+
3217
+ .preview-nav:focus-visible,
3218
+ .fs-btn:focus-visible {
3219
+ outline: 2px solid var(--sfx-up-ring, oklch(0.578 0.198 268.129 / 0.7));
3220
+ outline-offset: 2px;
3221
+ }
3222
+
3223
+ @media (prefers-reduced-motion: reduce) {
3224
+ .modal-backdrop { animation: none; }
3225
+ .modal-card { animation: none; }
3226
+ .inline { animation: none; }
3227
+ .fs-overlay { animation: none; }
3228
+ .body.has-files { animation: none; }
3229
+ }
3230
+
3231
+ /* --- Responsive: Tablet (≤ 768px) --- */
3232
+ @media (max-width: 768px) {
3233
+ .modal-backdrop { padding: 12px; }
3234
+ .modal-card { border-radius: 12px; max-height: 92vh; }
3235
+ .header { padding: 12px 16px; }
3236
+ .header-icon { width: 28px; height: 28px; margin-right: 10px; }
3237
+ .header-icon svg { width: 14px; height: 14px; }
3238
+ .header-title { font-size: 14px; }
3239
+ .body { padding: 16px; }
3240
+ .body.has-files { padding: 16px; padding-bottom: 12px; }
3241
+ .asset-count { padding: 12px 0 6px; font-size: 12px; }
3242
+
3243
+ .preview-layout { flex-direction: column; }
3244
+ .preview-layout .file-grid-side {
3245
+ width: 100%;
3246
+ max-height: 140px;
3247
+ overflow-x: auto;
3248
+ overflow-y: hidden;
3249
+ flex-shrink: 0;
3250
+ }
3251
+ .preview-panel { padding: 0 0 16px; }
3252
+
3253
+ .preview-topbar { padding: 8px 0; }
3254
+
3255
+ .inline { border-radius: 12px; }
3256
+
3257
+ .connector-modal-backdrop { padding: 8px; }
3258
+ .connector-modal {
3259
+ max-width: 100%;
3260
+ height: 85vh;
3261
+ max-height: none;
3262
+ border-radius: 14px;
3263
+ }
3264
+ }
3265
+
3266
+ /* --- Responsive: Mobile (≤ 480px) --- */
3267
+ @media (max-width: 480px) {
3268
+ .modal-backdrop { padding: 0; }
3269
+ .modal-card {
3270
+ border-radius: 0;
3271
+ max-height: 100vh;
3272
+ max-width: 100%;
3273
+ height: 100%;
3274
+ }
3275
+ .header { padding: 10px 14px; }
3276
+ .header-icon { width: 26px; height: 26px; margin-right: 8px; }
3277
+ .header-title { font-size: 14px; }
3278
+ .body { padding: 12px; }
3279
+ .body.has-files { padding: 12px; padding-bottom: 8px; }
3280
+ .asset-count { padding: 8px 0 4px; font-size: 11px; }
3281
+
3282
+ .preview-layout .file-grid-side { max-height: 100px; }
3283
+ .preview-panel { padding: 0 0 12px; }
3284
+ .preview-meta-row { padding: 6px 0; }
3285
+ .preview-meta-label { width: 90px; font-size: 12px; }
3286
+ .preview-meta-value { font-size: 12px; }
3287
+
3288
+ .inline { max-height: 100vh; border-radius: 8px; box-shadow: none; }
3289
+
3290
+ .connector-modal-backdrop { padding: 0; }
3291
+ .connector-modal {
3292
+ border-radius: 0;
3293
+ height: 100vh;
3294
+ max-height: none;
3295
+ min-height: auto;
3296
+ }
3297
+ }
3298
+ `,w._MODIFIABLE_STATUSES=new Set(["idle","queued","rejected"]),w._RESERVED_IDS=new Set(["device","camera","url","screen-cast"]),w);C([p.property({attribute:!1})],_.prototype,"config");C([p.state()],_.prototype,"_isOpen");C([p.state()],_.prototype,"_activeConnector");C([p.state()],_.prototype,"_showUrlDialog");C([p.state()],_.prototype,"_showCameraDialog");C([p.state()],_.prototype,"_showScreenCastDialog");C([p.state()],_.prototype,"_previewFileId");C([p.state()],_.prototype,"_previewDims");C([p.state()],_.prototype,"_fullscreenPreviewUrl");C([p.state()],_.prototype,"_fullscreenZoomed");C([p.state()],_.prototype,"_bodyDragOver");let pt=_;exports.AuthExpiredError=J;exports.CORE_SOURCES=M;exports.PublicEvents=x;exports.SfxActionsBar=$;exports.SfxCameraDialog=z;exports.SfxDropZone=b;exports.SfxFileItem=K;exports.SfxFileList=W;exports.SfxImportDivider=re;exports.SfxScreenCastDialog=P;exports.SfxSourcePills=X;exports.SfxSuccessCard=D;exports.SfxUploader=pt;exports.SfxUrlDialog=j;exports.Store=we;exports.UploadEngine=ke;exports.buildAuthHeaders=N;exports.createStore=_e;exports.exchangeSassKey=Ce;exports.getApiBase=Z;exports.getAuthUrl=ze;exports.getProviderSources=Se;exports.listFiles=Fe;exports.listNextPage=Te;exports.logout=Oe;exports.resolveAuth=$e;exports.searchProvider=Le;