{"id":5152,"date":"2026-10-02T00:38:17","date_gmt":"2026-10-01T16:38:17","guid":{"rendered":"https:\/\/www.zipget.cn\/?page_id=5152"},"modified":"2026-10-09T19:04:02","modified_gmt":"2026-10-09T11:04:02","slug":"image-workspace","status":"publish","type":"page","link":"https:\/\/www.zipget.cn\/en\/image-workspace\/","title":{"rendered":"Image Editor"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"5152\" class=\"elementor elementor-5152\">\n\t\t\t\t<div class=\"elementor-element elementor-element-ac38507b e-flex e-con-full e-con e-parent\" data-id=\"ac38507b\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t<div class=\"elementor-element elementor-element-57d7b17b e-flex e-con-full sd-workspace-nav e-con e-child\" data-id=\"57d7b17b\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t<div class=\"elementor-element elementor-element-cf71fc7f elementor-widget__width-initial elementor-widget-mobile__width-inherit elementor-widget elementor-widget-heading\" data-id=\"cf71fc7f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<div class=\"elementor-heading-title elementor-size-default\">\u521b\u4f5c\u5de5\u4f5c\u53f0<\/div>\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-6057e086 e-grid e-con-full e-con e-child\" data-id=\"6057e086\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-d62d646f elementor-align-justify elementor-widget__width-inherit elementor-widget elementor-widget-button\" data-id=\"d62d646f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/www.zipget.cn\/ppt-workspace\/\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">PPT\u7f16\u8f91<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-82f8ae3f elementor-align-justify elementor-widget__width-inherit elementor-widget elementor-widget-button\" data-id=\"82f8ae3f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/www.zipget.cn\/image-workspace\/\" aria-current=\"page\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">\u56fe\u7247\u7f16\u8f91<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-06ef516b elementor-align-justify elementor-widget__width-inherit elementor-widget elementor-widget-button\" data-id=\"06ef516b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/www.zipget.cn\/word-workspace\/\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">Word\u7f16\u8f91<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-945d3b9b elementor-align-justify elementor-widget__width-inherit elementor-widget elementor-widget-button\" data-id=\"945d3b9b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/www.zipget.cn\/excel-workspace\/\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">Excel\u7f16\u8f91<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f3e1b531 elementor-align-justify elementor-widget__width-inherit elementor-widget elementor-widget-button\" data-id=\"f3e1b531\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/www.zipget.cn\/audio-workspace\/\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">\u97f3\u9891\u7f16\u8f91<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a42b2424 elementor-align-justify elementor-widget__width-inherit elementor-widget elementor-widget-button\" data-id=\"a42b2424\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/www.zipget.cn\/video-workspace\/\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">\u89c6\u9891\u7f16\u8f91<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-90236fc9 elementor-align-justify elementor-widget__width-inherit elementor-widget elementor-widget-button\" data-id=\"90236fc9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/www.zipget.cn\/3d-workspace\/\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">3D\u6a21\u578b<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5ac490c8 elementor-widget elementor-widget-shortcode\" data-id=\"5ac490c8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\"><div class=\"sd-creative-export-notice\" style=\"display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:12px;padding:8px 14px;border:1px solid #e2e8f0;background:#f8fafc;font-size:12px;line-height:1.6\"><span>\u767b\u5f55\u540e\u53ef\u514d\u8d39\u4f7f\u7528\u57fa\u7840\u5bfc\u51fa<\/span><span>\u57fa\u7840\u5355\u56fe\u6700\u957f\u8fb9 2048 \u50cf\u7d20\uff1b\u9ad8\u6e05\u53ca\u6279\u91cf\u5bfc\u51fa\u4e3a\u4f1a\u5458\u529f\u80fd<\/span><a href=\"https:\/\/www.zipget.cn\/membership\/\" style=\"color:#1769d2;text-decoration:none\">\u67e5\u770b\u4f1a\u5458\u6743\u76ca<\/a><\/div><section class=\"sd-image-workspace-host\" aria-label=\"\u56fe\u7247\u7f16\u8f91\u5de5\u5177\"><iframe id=\"sd-image-workspace-1\" title=\"\u95ea\u5f97\u7d20\u6750\u56fe\u7247\u7f16\u8f91\u5de5\u4f5c\u53f0\" sandbox=\"allow-scripts allow-downloads\" allow=\"clipboard-write\" referrerpolicy=\"no-referrer\" style=\"display:block;width:100%;height:840px;min-height:400px;border:0;border-radius:12px;background:#f2f3f5;\" srcdoc=\"&lt;!doctype html&gt;&lt;html lang=&quot;zh-CN&quot;&gt;&lt;head&gt;&lt;script&gt;window.SHANDE_IMAGE_WORKSPACE={hostUrl:&quot;https:\\\/\\\/www.zipget.cn\\\/en\\\/&quot;};&lt;\/script&gt;&lt;meta charset=&quot;utf-8&quot;&gt;&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;&lt;title&gt;\u95ea\u5f97\u56fe\u7247\u7f16\u8f91\u5de5\u4f5c\u53f0&lt;\/title&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;https:\/\/www.zipget.cn\/wp-content\/themes\/astra-child\/assets\/creative-tools\/ui-fonts\/noto-sans-sc.css?v=20261013-noto-sandbox-1&quot;&gt;&lt;style&gt;\/* Shared creative-tool tokens. Color values are reused from the deployed image V1.2\r\n   interface; these are not a claim that an independently supplied brand manual exists. *\/\r\n:root {\r\n  --sd-primary: #2468eb;\r\n  --sd-primary-hover: #1955cb;\r\n  --sd-primary-soft: #eef4ff;\r\n  --sd-text: #202a3b;\r\n  --sd-text-secondary: #58677c;\r\n  --sd-muted: #738093;\r\n  --sd-border: #e5e9f0;\r\n  --sd-surface: #fff;\r\n  --sd-background: #f4f6f9;\r\n  --sd-radius-control: 8px;\r\n  --sd-radius-panel: 12px;\r\n  --sd-control-height: 40px;\r\n  --sd-touch-height: 44px;\r\n  --sd-font: &quot;Noto Sans SC&quot;, sans-serif;\r\n  --blue: var(--sd-primary);\r\n  --blue-soft: var(--sd-primary-soft);\r\n  --text: var(--sd-text);\r\n  --muted: var(--sd-muted);\r\n  --line: var(--sd-border);\r\n}\r\n&lt;\/style&gt;&lt;style&gt;:root{color-scheme:light;--blue:var(--sd-primary);--blue-soft:var(--sd-primary-soft);--text:var(--sd-text);--muted:var(--sd-muted);--line:var(--sd-border)}*{box-sizing:border-box}html{min-width:0}body{margin:0;color:var(--text);background:#f4f6f9;font:13px var(--sd-font);-webkit-font-smoothing:antialiased}button,a,input,select,textarea{font:inherit}button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:36px;max-width:100%;padding:8px 12px;border:1px solid #dce2eb;border-radius:7px;background:#fff;color:var(--text);line-height:1.3;cursor:pointer}button:hover{border-color:#adc6f6;background:#f4f8ff}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:2px solid var(--blue);outline-offset:3px}button:disabled{opacity:.4;cursor:not-allowed}button.primary{border-color:var(--blue);background:var(--blue);color:#fff;font-weight:600}button.primary:hover{background:#1955cb}button.active{border-color:#b7cef9;background:var(--blue-soft);color:var(--blue);font-weight:600}button.danger{color:#c13939;border-color:#eadcde}button.wide{width:100%}h1,h2,p{margin:0}h1{font-size:18px;line-height:1.4;letter-spacing:.3px}h2{font-size:14px;line-height:1.5;font-weight:600}p{line-height:1.7}a{color:var(--blue);text-decoration:none}[hidden]{display:none!important}.siw-app{width:100%;max-width:none;margin:auto;min-width:0}.siw-header{display:flex;align-items:center;gap:24px;min-height:76px;padding:14px 24px;background:#fff;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:10px;min-width:0}.brand-mark{display:grid;place-items:center;flex:0 0 37px;width:37px;height:37px;border-radius:10px;color:#fff;background:var(--blue);font-size:20px;font-weight:700}.header-subtitle{display:block;margin-top:2px;font-size:11px;color:var(--muted)}.version{align-self:flex-start;margin:4px 0 0 2px;color:#9ca7b8;font-size:10px}.header-history{display:flex;gap:3px;margin-left:auto}.header-history button{border:0;background:transparent;font-size:23px;min-width:37px;padding:3px 8px;color:#58677c}.header-history button span{font-size:12px}.header-actions{display:flex;align-items:center;gap:8px}.header-actions button{white-space:nowrap;padding:9px 15px}.siw-nav{display:flex;align-items:center;gap:20px;min-height:34px;padding:5px 25px;font-size:11px}.siw-nav a{color:#8290a4}.notice{margin:8px 16px 0;padding:10px 14px;background:#edf4ff;border:1px solid #c5d8ff;border-radius:8px;color:#215dba;font-size:12px;line-height:1.7;overflow-wrap:anywhere}.notice.error{background:#fff4f2;border-color:#f1cdc8;color:#b33c30}\r\n.workspace{display:grid;grid-template-columns:80px 320px minmax(0,1fr);gap:12px;min-width:0;padding:0 16px 16px;align-items:start}.tool-rail{display:flex;flex-direction:column;gap:6px;padding:9px 5px;background:#fff;border:1px solid var(--line);border-radius:10px;min-width:0}.tool-rail .mode-button{display:flex;flex-direction:column;gap:8px;min-height:72px;padding:10px 1px;border:1px solid transparent;border-radius:8px;font-size:11px;line-height:1.4;white-space:nowrap;color:#69758a}.tool-rail .mode-button svg{display:block;width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.tool-rail .mode-button:hover{background:#f4f7fc;color:var(--blue)}.tool-rail .mode-button.active{color:var(--blue);border-color:#deebff;background:var(--blue-soft);font-weight:600}.stage-panel{min-width:0;padding:16px;background:#fff;border:1px solid var(--line);border-radius:10px}.stage-top{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:12px;min-width:0}.stage-top&gt;div{min-width:0}.stage-top h2{font-size:16px;margin-bottom:4px}.hint{font-size:11px;line-height:1.7;color:var(--muted);margin:8px 0 12px;overflow-wrap:anywhere}.stage-top .hint{margin:0;max-width:600px}#canvasInfo{flex-shrink:0;font-size:11px;color:#8490a2;margin-top:4px;white-space:nowrap;font-variant-numeric:tabular-nums}.selection-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;min-width:0}.segmented{display:flex;padding:3px;border-radius:8px;background:#f3f5f9;gap:2px;min-width:0}.segmented button{padding:7px 12px;min-height:31px;border-color:transparent;background:transparent;font-size:12px;white-space:nowrap;color:#66748a}.segmented button.active{border-color:#e0e7f4;background:#fff;color:var(--blue);box-shadow:0 1px 3px #2335540d}.padding-control{display:flex;align-items:center;gap:5px;flex-shrink:0;font-size:11px;color:var(--muted)}.padding-control input{width:46px;min-width:0;height:31px;padding:4px;border:1px solid #dce2eb;border-radius:6px;color:var(--text);background:#fff;text-align:center}.padding-control span{font-size:10px;color:#99a3b3}.stage-wrap{position:relative;display:flex;align-items:safe center;justify-content:safe center;min-width:0;height:clamp(380px,calc(100svh - 300px),640px);padding:24px;overflow:auto;overscroll-behavior:contain;border:1px solid #e1e6ed;border-radius:8px;background:#f0f2f6;scrollbar-width:thin;scrollbar-color:#c3cbd8 #f0f2f6;touch-action:pan-x pan-y}.stage-wrap canvas{display:block;flex:none;max-width:100%;max-height:100%;width:auto;height:auto;background:repeating-conic-gradient(#e4e8ee 0% 25%,#fff 0% 50%) 50%\/16px 16px;box-shadow:0 3px 18px #2335541b;touch-action:none}.empty-stage{position:absolute;inset:0;margin:24px;padding:20px 12px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;border:1px dashed #cbd5e4;border-radius:8px;background:#fbfcfe;text-align:center}.empty-icon{display:grid;place-items:center;width:56px;height:56px;border-radius:18px;background:#eef4ff;color:var(--blue);font-size:34px;font-weight:300;line-height:1}.empty-stage h2{font-size:18px;margin-top:2px}.empty-stage p{font-size:12px;color:#7d899c;line-height:1.9}.empty-stage button{margin-top:4px;padding:10px 18px}.empty-stage small{font-size:10px;color:#9aa5b7;line-height:1.6}.selection-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-top:12px}#selectionInfo{font-size:11px;color:var(--muted);line-height:1.6;overflow-wrap:anywhere}.button-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}.selection-actions .button-row{gap:5px}.selection-actions button{font-size:11px;min-height:32px;padding:7px 9px}#queueSelection,#mobilePropertiesToggle{display:none}.selection-advanced{margin-top:12px;padding-top:10px;border-top:1px solid #f0f2f6}.selection-advanced summary{color:#8b96a8;font-size:11px}.selection-advanced .button-row{margin-top:9px}.selection-advanced button{font-size:11px;min-height:31px;padding:6px 9px}.stage-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding-top:12px;margin-top:12px;border-top:1px solid #edf0f5}.zoom-controls{display:flex;align-items:center;gap:3px;min-width:0}.stage-bottom button{font-size:11px;padding:5px 8px;min-height:29px;border-color:#e5e9f0;color:#708097}.zoom-controls button:first-child,.zoom-controls button:nth-child(3){font-size:17px;padding:2px 8px}.zoom-controls span{min-width:40px;text-align:center;font-size:11px;color:#7c899d;font-variant-numeric:tabular-nums}.siw-app:not([data-mode=&quot;selection&quot;]) .selection-tools,.siw-app:not([data-mode=&quot;selection&quot;]) .selection-actions,.siw-app:not([data-mode=&quot;selection&quot;]) .selection-advanced{display:none}\r\n.inspector{min-width:0;padding:16px;background:#fff;border:1px solid var(--line);border-radius:10px;max-height:calc(100svh - 136px);min-height:580px;overflow:auto;scrollbar-width:thin;scrollbar-color:#c9d0dc transparent}.property-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:13px;margin-bottom:12px;border-bottom:1px solid #edf0f5}.property-heading h2{font-size:15px}.property-heading #propertiesClose{display:none}.inspector button{font-size:11px}.queue-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:#627188}.queue-heading strong{font-size:16px;color:var(--blue);margin:0 2px}.queue-heading .hint{font-size:10px;margin:0;color:#9aa4b5}.selection-queue{display:grid;gap:9px;margin:12px 0;max-height:380px;min-height:100px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}.queue-empty{display:flex;align-items:center;justify-content:center;min-height:168px;border:1px dashed #dbe3ef;border-radius:8px;background:#fbfcff;text-align:center;line-height:2;font-size:11px;color:#9aa7ba}.queue-item,.queue-card{display:grid;grid-template-columns:66px minmax(0,1fr);gap:10px;padding:9px;border:1px solid #e8edf5;border-radius:8px;background:#fafbfd;min-width:0}.queue-item img,.queue-card img,.queue-preview,.queue-thumb{display:block;width:66px;height:66px;object-fit:contain;border:1px solid #e7eaf0;border-radius:5px;background:repeating-conic-gradient(#e9edf3 0% 25%,#fff 0% 50%) 50%\/12px 12px}.queue-meta{min-width:0}.queue-name{font-size:11px;line-height:1.5;color:#465773;overflow-wrap:anywhere}.queue-item small,.queue-card small{display:block;margin-top:3px;color:#9aa6b7;font-size:10px}.queue-item .button-row,.queue-card .button-row,.queue-item .queue-buttons,.queue-card .queue-buttons{display:flex;gap:5px;margin-top:7px;flex-wrap:wrap}.queue-item button,.queue-card button{font-size:10px;min-height:25px;padding:4px 7px}.queue-actions{padding-top:2px}.queue-actions&gt;.button-row{margin-top:7px;gap:5px}.queue-actions&gt;.button-row button{flex:1;min-width:0;padding:7px 5px;min-height:31px;font-size:10px}.queue-actions&gt;.primary{font-size:12px;min-height:37px}.tabs{display:flex;gap:5px;border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:14px}.tabs button{flex:1;font-size:11px}.tab-content&gt;h2,.property-group&gt;h2,#collagePanel&gt;h2,#morePanel&gt;h2{margin-bottom:12px}.property-group{margin-bottom:16px}.property-group&gt;.button-row button{flex:1 1 calc(50% - 6px);min-width:0;min-height:34px}.field{display:grid;gap:7px;margin:12px 0;font-size:11px;color:#637187;position:relative}.field output{position:absolute;right:0;top:0;color:#8995a8;font-variant-numeric:tabular-nums}.field input:not([type=range]):not([type=color]),.field select,.field textarea{width:100%;min-width:0;border:1px solid #dce2eb;border-radius:6px;padding:8px 9px;background:#fff;color:var(--text);line-height:1.4;font-size:12px}.field textarea{resize:vertical;min-height:76px}.field input[type=range]{width:100%;margin:3px 0 0;accent-color:var(--blue);cursor:pointer}.field input[type=color]{width:100%;height:35px;padding:3px;background:#fff;border:1px solid #dce2eb;border-radius:6px}.grid2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 10px}.check{display:flex;align-items:flex-start;gap:7px;font-size:11px;line-height:1.7;color:#6d7b8f;margin:11px 0}.check input{flex-shrink:0;margin:3px 0 0;accent-color:var(--blue)}.divider{border-top:1px solid #edf0f5;margin:18px 0}.presets{margin-top:12px}.presets button{flex:1 1 calc(50% - 6px);padding:6px;font-size:10px}.picked-color{display:flex;align-items:center;gap:10px;margin-top:12px;padding:10px;border:1px solid #e6ebf3;border-radius:6px;background:#f8fafc;font-size:11px;overflow-wrap:anywhere}.color-chip{flex-shrink:0;width:24px;height:24px;border:1px solid #c9d0dc;border-radius:4px}#canvasBg{width:100%;height:36px;padding:3px;border:1px solid #dce2eb;border-radius:6px;background:#fff}.more-actions{display:grid;gap:8px}.more-actions button{width:100%;justify-content:flex-start;padding:10px 12px}.layers-details{margin-top:18px;padding-top:13px;border-top:1px solid #edf0f5}.layers-details summary,.style-details summary,.grid-details summary{font-size:12px;color:#65758c;cursor:pointer}.layers-details summary span{display:inline-block;margin-left:5px;min-width:18px;padding:1px 5px;border-radius:9px;background:#f0f4fb;color:#8995a8;font-size:10px;text-align:center}.layer-list{display:grid;gap:7px;margin:12px 0;max-height:260px;overflow:auto;scrollbar-width:thin}.layer-card{display:flex;gap:8px;align-items:center;width:100%;min-width:0;text-align:left;padding:7px;background:#fafbfd;border:1px solid #e7ebf3;position:relative;justify-content:flex-start}.layer-card.selected{border-color:#a7c5ff;background:#f0f5ff}.layer-thumb{flex-shrink:0;width:38px;height:38px;object-fit:contain;background:repeating-conic-gradient(#e3e8ef 0% 25%,#fff 0% 50%) 50%\/10px 10px;border-radius:4px}.layer-name{display:block;font-size:11px;line-height:1.5;overflow-wrap:anywhere;max-width:170px}.layer-meta{display:block;margin-top:3px;font-size:9px;color:#9aa5b7}.layer-hide{flex-shrink:0;margin-left:auto;padding:3px;min-height:24px;border:0;background:transparent;color:#8795ab}.empty-list{font-size:11px;color:#9aa6b8;text-align:center;padding:23px 5px;line-height:2}.layer-buttons{gap:4px;margin-bottom:8px}.layer-buttons button{flex:1;min-width:0;padding:6px;font-size:10px}.style-details{margin:15px 0}.style-details[open] summary{margin-bottom:8px}.grid-details{padding-top:14px;border-top:1px solid #edf0f5}.downloads{margin-top:12px;padding:11px 13px;border-radius:7px;background:#edf8f2}.downloads a{display:block;margin:6px 0;color:#06734b;font-size:11px;overflow-wrap:anywhere}.downloads p{font-size:11px;color:#06734b}.drawer-backdrop{display:none}summary{cursor:pointer;line-height:1.8}dialog{width:430px;max-width:calc(100% - 28px);max-height:calc(100svh - 32px);overflow:auto;margin:auto;padding:24px;border:1px solid #dbe2ed;border-radius:13px;background:#fff;box-shadow:0 24px 80px #1b2a4440;color:var(--text)}dialog::backdrop{background:#26354d80}.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.dialog-head h2{font-size:17px}.icon-btn{font-size:24px;border:0;min-width:30px;min-height:30px;padding:0 6px;color:#98a4b7}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:22px}.dialog-actions button{font-size:12px}body.busy{cursor:progress}body.busy .workspace,body.busy .header-actions{pointer-events:none;opacity:.65}\r\n@media(min-width:1600px){.workspace{gap:16px;padding:0 24px 24px}.stage-panel{padding:20px}.stage-wrap{height:clamp(430px,calc(100svh - 300px),740px)}}\r\n@media(max-width:1150px) and (min-width:761px){.siw-header{padding:12px 16px;gap:14px}.workspace{grid-template-columns:74px 288px minmax(0,1fr);gap:9px;padding:0 10px 12px}.stage-panel,.inspector{padding:13px}.tool-rail .mode-button{font-size:10px;min-height:68px}.header-actions button{padding:8px 11px}.header-history button span{display:none}.stage-top .hint{font-size:10px}.selection-tools{gap:6px}.segmented button{padding:7px 8px;font-size:11px}.stage-wrap{padding:18px}.empty-stage{margin:18px}.selection-actions{align-items:flex-start}.selection-actions .button-row{margin-left:auto}.selection-actions button{font-size:10px;padding:6px 7px}.inspector{min-height:560px}}\r\n@media(max-width:900px) and (min-width:761px){.workspace{grid-template-columns:68px 264px minmax(0,1fr);gap:7px}.stage-panel,.inspector{padding:11px}.tool-rail{padding:5px 3px}.segmented button{padding:6px;font-size:10px}.padding-control{font-size:10px;gap:3px}.padding-control input{width:37px}.stage-top{gap:6px}#canvasInfo{font-size:10px}.stage-top h2{font-size:15px}.stage-wrap{height:440px;min-height:0}.selection-actions #selectionInfo{width:100%}}\r\n@media(max-width:760px){body{background:#f3f5f9}.siw-header{min-height:69px;padding:12px 14px;gap:8px;flex-wrap:wrap}.brand{gap:8px;flex:1}.brand-mark{width:32px;height:32px;flex-basis:32px;font-size:17px;border-radius:9px}h1{font-size:16px}.header-subtitle{font-size:10px;margin-top:1px}.version{font-size:9px;margin-left:0}.header-history{gap:0;margin-left:auto}.header-history button{font-size:22px;min-width:30px;min-height:31px;padding:2px 5px}.header-history button span{display:none}.header-actions{width:100%;gap:7px;padding-top:5px}.header-actions button{flex:1;min-width:0;min-height:35px;font-size:12px;padding:8px}.header-actions .desktop-save{display:none}.siw-nav{padding:5px 14px;min-height:30px;gap:17px;font-size:10px;flex-wrap:wrap}.notice{margin:7px 10px 0;padding:9px 11px;font-size:11px}.workspace{display:flex;flex-direction:column;gap:0;padding:0;min-width:0;align-items:stretch}.stage-panel{order:1;width:100%;padding:12px 12px 10px;border-radius:0;border-left:0;border-right:0}.stage-top{gap:8px;margin-bottom:10px}.stage-top h2{font-size:15px;margin-bottom:3px}.stage-top .hint{font-size:10px;line-height:1.7}#canvasInfo{font-size:9px;margin-top:5px}.selection-tools{margin-bottom:10px;gap:7px;align-items:center}.segmented{flex:1;padding:2px;gap:1px}.segmented button{flex:1;min-width:0;min-height:31px;padding:6px 4px;font-size:11px}.padding-control{gap:3px;font-size:10px}.padding-control input{width:35px;height:31px;font-size:11px}.padding-control span{display:none}.stage-wrap{height:clamp(310px,112vw,470px);min-height:0;padding:15px;border-radius:7px}.empty-stage{margin:15px;padding:15px 8px;gap:10px}.empty-icon{width:48px;height:48px;font-size:29px;border-radius:15px}.empty-stage h2{font-size:16px}.empty-stage p{font-size:11px;line-height:1.9}.empty-stage small{font-size:9px}.selection-actions{gap:7px;margin-top:9px;align-items:center}.selection-actions #selectionInfo{width:100%;font-size:10px}.selection-actions .button-row{width:100%;gap:5px}.selection-actions button{min-height:34px;padding:7px 9px;font-size:11px}.selection-actions #downloadSelection{flex:1}.selection-actions #clearSelection{padding:7px;font-size:10px}#mobilePropertiesToggle{display:inline-flex;margin-left:auto;gap:4px;padding:7px 8px;color:var(--blue);border-color:#c6d9ff;background:#f6f9ff}#mobileCutCount{display:inline-grid;place-items:center;min-width:17px;min-height:17px;padding:0 3px;background:#e2ecff;border-radius:5px;font-size:10px;font-weight:600}.siw-app:not([data-mode=&quot;selection&quot;]) .selection-actions{display:flex;justify-content:flex-end;margin-top:8px}.siw-app:not([data-mode=&quot;selection&quot;]) .selection-actions #selectionInfo,.siw-app:not([data-mode=&quot;selection&quot;]) .selection-actions .button-row&gt;button:not(#mobilePropertiesToggle){display:none}.siw-app:not([data-mode=&quot;selection&quot;]) .selection-actions .button-row{justify-content:flex-end}.selection-advanced{margin-top:9px;padding-top:7px}.selection-advanced summary{font-size:10px}.selection-advanced button{font-size:10px;padding:6px;flex:1}.stage-bottom{margin-top:9px;padding-top:9px;gap:5px}.stage-bottom button{font-size:10px;min-height:28px;padding:4px 6px}.zoom-controls{gap:2px}.zoom-controls span{min-width:33px;font-size:10px}.zoom-controls button:first-child,.zoom-controls button:nth-child(3){padding:2px 6px;font-size:16px}#showLayers{padding:5px 7px;font-size:10px}.tool-rail{order:2;position:sticky;bottom:0;z-index:30;display:grid;grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:64px;overflow-x:auto;gap:2px;width:100%;padding:5px 6px calc(5px + env(safe-area-inset-bottom));border:0;border-top:1px solid #e0e7f2;border-radius:0;background:#fff;box-shadow:0 -4px 20px #24385408}.tool-rail .mode-button{min-width:0;min-height:59px;padding:7px 0 5px;gap:6px;border-radius:7px;font-size:10px;line-height:1.25;white-space:normal}.tool-rail .mode-button svg{width:21px;height:21px;stroke-width:1.7}.tool-rail .desktop-mode{display:flex}.inspector{position:fixed;inset:auto 0 0;z-index:60;max-height:78svh;min-height:0;padding:16px 18px calc(20px + env(safe-area-inset-bottom));border:1px solid #dce4f1;border-bottom:0;border-radius:17px 17px 0 0;box-shadow:0 -12px 45px #20355326;background:#fff;overflow:auto;overscroll-behavior:contain;transform:translateY(105%);transition:transform .2s ease;visibility:hidden;pointer-events:none}.inspector.open{transform:translateY(0);visibility:visible;pointer-events:auto}.property-heading{position:sticky;top:-16px;z-index:2;background:#fff;margin:-2px 0 13px;padding:2px 0 12px}.property-heading h2{font-size:15px}.property-heading #propertiesClose{display:inline-flex;border:0;padding:0;min-width:29px;min-height:29px;font-size:23px;color:#8390a5;background:#f5f7fb;border-radius:50%}.drawer-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:55;background:#21334c70;backdrop-filter:blur(1px)}.selection-queue{grid-template-columns:repeat(2,minmax(0,1fr));max-height:280px;min-height:80px;gap:8px}.queue-empty{grid-column:1\/-1;min-height:120px}.queue-item,.queue-card{grid-template-columns:1fr;gap:6px;padding:8px}.queue-item img,.queue-card img,.queue-preview,.queue-thumb{width:100%;height:91px}.queue-name{font-size:10px}.queue-actions&gt;.button-row button{font-size:11px;min-height:34px}.queue-actions&gt;.primary{min-height:40px}.layer-list{max-height:210px}.layer-name{max-width:none}.more-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.more-actions button{font-size:11px;padding:10px;justify-content:center;min-height:43px}.more-actions button:last-child{grid-column:1\/-1}dialog{padding:20px;max-width:calc(100% - 24px);max-height:85svh}.dialog-head h2{font-size:16px}.dialog-actions{gap:7px;margin-top:18px}.dialog-actions button{flex:1;padding:9px 7px;font-size:11px}}\r\n@media(max-width:340px){.siw-header{padding:10px}.brand-mark{width:29px;height:29px;flex-basis:29px;font-size:16px}h1{font-size:14px}.header-subtitle{font-size:9px}.header-history button{min-width:25px;padding:2px 3px}.version{display:none}.siw-nav{padding-inline:10px;gap:12px}.stage-panel{padding:10px 9px 8px}.stage-top{gap:5px}.stage-top .hint{font-size:9px}#canvasInfo{font-size:8px}.segmented button{font-size:10px;padding:6px 2px}.selection-tools{gap:5px}.padding-control{font-size:9px;gap:2px}.padding-control input{width:30px;font-size:10px}.selection-actions .button-row{gap:4px}.selection-actions #downloadSelection{font-size:10px;padding:7px 6px}.selection-actions #clearSelection{display:none}#mobilePropertiesToggle{font-size:10px;padding:7px 5px}.stage-wrap{height:330px;padding:10px}.empty-stage{margin:10px;gap:9px}.empty-stage h2{font-size:14px}.empty-stage p{font-size:10px}.empty-stage button{font-size:11px;padding:9px 13px}.tool-rail{padding-inline:3px;gap:1px}.tool-rail .mode-button{font-size:9px;min-height:57px}.tool-rail .mode-button svg{width:20px;height:20px}.inspector{padding:14px 12px calc(17px + env(safe-area-inset-bottom))}.property-heading{top:-14px}.zoom-controls button:last-child{font-size:9px;padding-inline:4px}.stage-bottom #showLayers{font-size:9px;padding-inline:5px}}\r\n@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}\r\n\r\n.queue-item-actions{grid-column:1\/-1;display:flex;gap:6px;justify-content:flex-end;min-width:0}.queue-meta&gt;span{display:block;margin-top:4px;color:#8795ab;font-size:10px;line-height:1.5;overflow-wrap:anywhere}.queue-meta&gt;small{overflow-wrap:anywhere}.queue-item-actions button{min-width:0}.queue-card .queue-name{display:block}\r\n\r\n.button-icon{width:16px;height:16px;flex:0 0 16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.segmented .button-icon{width:15px;height:15px;flex-basis:15px}.queue-item-actions button:first-child::before{content:&quot;\u2193&quot;;font-size:14px;line-height:1}.queue-item-actions .danger::before{content:&quot;\u00d7&quot;;font-size:15px;line-height:1}\r\n@media(max-width:760px){.stage-wrap{height:clamp(220px,calc(100svh - 382px),470px)}.segmented .button-icon{width:14px;height:14px;flex-basis:14px}.selection-actions #downloadSelection{min-width:0}.queue-item-actions button{min-height:36px;flex:1}.property-group&gt;.button-row button,.layer-buttons button{min-height:39px}.tool-rail .mode-button{min-height:62px}.inspector button{min-height:36px}}\r\n@media(max-width:340px){.segmented .button-icon{width:12px;height:12px;flex-basis:12px}.segmented button{gap:3px}.selection-actions button .button-icon{width:14px;height:14px;flex-basis:14px}}\r\n\r\n\/* V1.3: a calmer workbench, readable controls, and separate narrow-screen layout. *\/\r\nbody{font:13px var(--sd-font);background:var(--sd-background);color:var(--sd-text)}\r\nbutton{min-height:var(--sd-control-height);border-radius:var(--sd-radius-control);gap:7px;padding:9px 12px}\r\nbutton:disabled{opacity:.48}\r\nbutton.primary:hover{background:var(--sd-primary-hover)}\r\n.siw-app{max-width:none}\r\n.siw-header{min-height:84px;padding:16px 20px;gap:18px}\r\n.brand{gap:10px;flex-shrink:0}\r\n.brand-mark{width:36px;height:36px;flex-basis:36px;border-radius:10px;font-size:20px}\r\nh1{font-size:18px;letter-spacing:0}\r\n.header-subtitle{font-size:11px;color:var(--sd-text-secondary);margin-top:3px}\r\n.version{font-size:10px;color:var(--sd-muted);margin-top:5px}\r\n.project-status{font-size:12px;color:var(--sd-text-secondary);line-height:1.6;display:flex;align-items:center;gap:6px;white-space:nowrap}\r\n.project-status::before{content:&quot;&quot;;width:6px;height:6px;border-radius:50%;background:var(--sd-muted);flex-shrink:0}\r\n.header-history{gap:1px;margin-left:auto;border-right:1px solid var(--sd-border);padding-right:12px}\r\n.header-history button{min-height:38px;min-width:36px;padding:7px;color:var(--sd-text-secondary)}\r\n.header-history button span{font-size:12px}\r\n.header-history .button-icon{width:17px;height:17px}\r\n.header-actions{gap:8px}\r\n.header-actions button{padding:9px 13px;font-size:12px;min-height:40px}\r\n.siw-nav{padding:6px 20px;min-height:30px;font-size:12px}\r\n.siw-nav a{color:var(--sd-text-secondary)}\r\n.notice{margin:0;padding:10px 20px;border:0;border-bottom:1px solid #c5d8ff;border-radius:0;font-size:12px}\r\n.workspace{grid-template-columns:72px 292px minmax(0,1fr);gap:12px;padding:16px;align-items:stretch}\r\n.tool-rail{padding:6px;background:var(--sd-surface);border-radius:var(--sd-radius-panel);gap:4px;align-self:start}\r\n.tool-rail .mode-button{min-height:68px;gap:7px;padding:9px 0;font-size:11px;color:var(--sd-text-secondary);border-radius:8px}\r\n.tool-rail .mode-button svg{width:23px;height:23px;stroke-width:1.7}\r\n.stage-panel{padding:16px;display:flex;flex-direction:column;border-radius:var(--sd-radius-panel);min-width:0}\r\n.stage-top{margin-bottom:14px;gap:10px;align-items:center;flex-wrap:wrap}\r\n.stage-top h2{font-size:16px;margin-bottom:4px}\r\n.stage-top .hint{font-size:12px;line-height:1.7;max-width:none;color:var(--sd-text-secondary)}\r\n#canvasInfo{font-size:11px;color:var(--sd-text-secondary);margin:0;background:var(--sd-background);padding:4px 7px;border-radius:5px}\r\n.hint{font-size:12px;color:var(--sd-text-secondary);line-height:1.75;margin:10px 0 14px}\r\n.selection-tools{margin-bottom:12px;gap:8px;flex-wrap:wrap}\r\n.segmented{padding:3px;gap:2px;border-radius:9px;flex:0 1 auto}\r\n.segmented button{font-size:12px;padding:7px 10px;min-height:36px;gap:6px}\r\n.padding-control{font-size:12px;gap:5px;margin-left:auto;color:var(--sd-text-secondary)}\r\n.padding-control input{height:36px;width:45px;border-radius:7px;font-size:12px}\r\n.padding-control span{font-size:11px;color:var(--sd-muted)}\r\n.stage-wrap{height:clamp(320px,39vw,440px);padding:24px;border:1px solid var(--sd-border);border-radius:9px;background:#f0f2f6;flex:1 0 auto}\r\n.stage-wrap canvas{box-shadow:0 3px 16px #23355414}\r\n.empty-stage{margin:20px;padding:24px 16px;gap:10px;background:#fbfcfe;border-color:#cbd5e4;border-radius:10px}\r\n.empty-icon{width:76px;height:76px;border-radius:23px;background:var(--sd-primary-soft);margin-bottom:4px}\r\n.empty-icon svg{width:52px;height:52px;fill:none;stroke:currentColor;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round}\r\n.empty-stage h2{font-size:20px;font-weight:600;line-height:1.5}\r\n.empty-stage p{font-size:12px;color:var(--sd-text-secondary);line-height:1.9}\r\n.empty-stage button{font-size:13px;padding:11px 20px;min-height:44px;margin-top:9px}\r\n.empty-stage small{font-size:11px;color:var(--sd-muted);margin-top:3px}\r\n.selection-actions{margin-top:12px;gap:8px;align-items:center}\r\n#selectionInfo{font-size:11px;color:var(--sd-text-secondary)}\r\n.selection-actions button{min-height:36px;font-size:12px;padding:8px 10px}\r\n.selection-actions #downloadSelection{background:#fff;color:var(--blue);border-color:#b7cef9;font-weight:500}\r\n.selection-actions #downloadSelection:hover{background:var(--sd-primary-soft)}\r\n.selection-actions #clearSelection{font-size:11px;border-color:transparent;padding:7px}\r\n.selection-advanced{border:0;margin-top:9px;padding-top:0}\r\n.selection-advanced summary{font-size:12px;color:var(--sd-text-secondary);padding:4px 0;min-height:28px}\r\n.selection-advanced button{font-size:11px;min-height:36px;padding:7px 10px}\r\n.stage-bottom{padding-top:11px;margin-top:10px;flex-wrap:nowrap;gap:8px}\r\n.stage-bottom button{min-height:34px;padding:6px 9px;font-size:11px;color:var(--sd-text-secondary)}\r\n.zoom-controls{gap:4px}\r\n.zoom-controls button:first-child,.zoom-controls button:nth-child(3){min-width:32px;font-size:18px;padding:3px 7px}\r\n.zoom-controls span{font-size:11px;min-width:35px;color:var(--sd-text-secondary)}\r\n.inspector{padding:16px;max-height:none;min-height:0;border-radius:var(--sd-radius-panel);overflow:visible;align-self:start}\r\n.property-heading{padding-bottom:13px;margin-bottom:14px}\r\n.property-heading h2{font-size:15px}\r\n.inspector button{font-size:12px;min-height:38px}\r\n.queue-heading{font-size:12px;color:var(--sd-text-secondary)}\r\n.queue-heading strong{font-size:18px;margin-inline:4px}\r\n.format-badge{font-size:10px;padding:4px 7px;line-height:1.4;border-radius:5px;background:var(--sd-background);color:var(--sd-text-secondary);white-space:nowrap}\r\n.queue-description{font-size:11px;margin:9px 0 12px}\r\n.selection-queue{gap:10px;max-height:360px;min-height:100px;margin:0 0 12px;padding:1px}\r\n.queue-empty{min-height:190px;padding:22px 12px;border-radius:9px;font-size:12px;line-height:2.1;white-space:pre-line;color:var(--sd-text-secondary);background:#fbfcfe}\r\n.queue-card{grid-template-columns:62px minmax(0,1fr);gap:8px 10px;padding:10px;border-radius:9px;background:#fff;border:1px solid var(--sd-border)}\r\n.queue-thumb{width:62px;height:58px;border-radius:6px}\r\n.queue-name{font-size:12px;line-height:1.5;color:var(--sd-text)}\r\n.queue-meta&gt;span{font-size:11px;margin-top:4px;color:var(--sd-text-secondary)}\r\n.queue-meta&gt;small{font-size:10px;color:var(--sd-muted);margin-top:3px;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}\r\n.queue-item-actions{gap:6px;justify-content:stretch;padding-top:1px}\r\n.queue-item-actions button{font-size:11px;min-height:34px;flex:1;padding:6px 8px}\r\n.queue-item-actions .danger{flex:0 0 auto;min-width:58px;border-color:transparent}\r\n.queue-actions{padding-top:0}\r\n.queue-actions&gt;.primary{min-height:42px;font-size:12px}\r\n.queue-actions&gt;.button-row{gap:4px;margin-top:8px}\r\n.queue-actions&gt;.button-row button{min-height:34px;padding:6px 4px;font-size:10px;gap:3px}\r\n.queue-actions&gt;.button-row .button-icon{width:14px;height:14px;flex-basis:14px}\r\n.export-details{margin-top:12px}\r\n.export-details summary{font-size:11px;color:var(--sd-text-secondary)}\r\n.export-details .hint{font-size:11px;margin:8px 0 0}\r\n.layers-details{margin-top:16px;padding-top:12px}\r\n.layers-details summary,.style-details summary,.grid-details summary{font-size:12px;color:var(--sd-text-secondary);min-height:30px;padding:3px 0}\r\n.layers-details summary span{font-size:11px;color:var(--sd-text-secondary)}\r\n.layer-list{max-height:260px}\r\n.layer-card{padding:8px;gap:9px}\r\n.layer-name{font-size:12px;max-width:150px}\r\n.layer-meta{font-size:10px;color:var(--sd-text-secondary)}\r\n.layer-hide{min-height:32px!important;min-width:30px}\r\n.layer-buttons button{font-size:11px;min-height:36px;padding:6px 5px}\r\n.empty-list{font-size:12px;color:var(--sd-text-secondary)}\r\n.field{font-size:12px;color:var(--sd-text-secondary);margin:14px 0;gap:8px}\r\n.field output{color:var(--sd-text-secondary)}\r\n.field input:not([type=range]):not([type=color]),.field select,.field textarea{font-size:13px;border-radius:7px;min-height:38px;padding:9px}\r\n.field input[type=range]{min-height:22px}\r\n.field input[type=color]{height:38px;border-radius:7px}\r\n.field textarea{line-height:1.7}\r\n.check{font-size:12px;color:var(--sd-text-secondary);margin:12px 0;gap:8px}\r\n.check input{width:15px;height:15px;margin-top:3px}\r\n.property-group{margin-bottom:20px}\r\n.property-group&gt;.button-row{gap:7px;margin-top:7px}\r\n.property-group&gt;.button-row button{min-height:38px;font-size:11px;padding:8px 7px}\r\n.presets button{font-size:11px;min-height:36px}\r\n.more-actions{gap:8px}\r\n.more-actions button{min-height:42px;font-size:12px;gap:9px}\r\n.downloads{padding:12px;border:1px solid #c5d8ff;background:var(--sd-primary-soft);border-radius:8px;margin-top:12px}\r\n.downloads p,.downloads a{font-size:12px;color:#215dba;line-height:1.7}\r\n.downloads a{text-decoration:underline;text-underline-offset:3px}\r\n.workspace-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 20px 15px;font-size:12px;line-height:1.8;color:var(--sd-text-secondary)}\r\n.workspace-footer a{color:var(--sd-text-secondary);text-decoration:underline;text-underline-offset:3px}\r\n.workspace-footer a:hover{color:var(--sd-primary)}\r\ndialog{border-radius:14px;padding:24px;width:460px}\r\n.dialog-head{margin-bottom:14px}\r\n.dialog-head h2{font-size:18px}\r\n.icon-btn{min-width:36px;min-height:36px;color:var(--sd-text-secondary)}\r\n.dialog-actions button{min-height:40px;font-size:12px}\r\n@media(min-width:1450px){.workspace{grid-template-columns:80px 316px minmax(0,1fr);padding:20px;gap:16px}.stage-panel,.inspector{padding:20px}.stage-wrap{height:480px}.queue-actions&gt;.button-row button{font-size:11px}.tool-rail .mode-button{font-size:12px}.selection-actions{flex-wrap:nowrap}}\r\n@media(min-width:901px) and (max-width:1190px){.siw-header{gap:12px;padding:14px 16px}.project-status{font-size:11px}.header-history{gap:0;padding-right:8px}.header-history button span{display:none}.header-actions button{padding:9px 11px}.workspace{grid-template-columns:68px 272px minmax(0,1fr);gap:10px;padding:12px}.stage-panel,.inspector{padding:14px}.segmented button{font-size:11px;padding:7px 8px}.stage-top .hint{font-size:11px}.stage-wrap{padding:20px;height:390px}.selection-actions{align-items:flex-start}.selection-actions #selectionInfo{width:100%}.selection-actions .button-row{margin-left:auto}.empty-stage h2{font-size:18px}.queue-actions&gt;.button-row button{font-size:10px;gap:2px}.queue-actions&gt;.button-row .button-icon{width:12px;height:12px;flex-basis:12px}}\r\n@media(max-width:900px){\r\n  body{background:var(--sd-background)}\r\n  .siw-header{display:grid;grid-template-columns:minmax(0,1fr) auto;min-height:0;padding:14px 14px 12px;gap:10px 8px}\r\n  .brand{min-width:0;gap:8px}.brand-mark{width:33px;height:33px;flex-basis:33px;font-size:18px;border-radius:9px}h1{font-size:16px}.header-subtitle{font-size:10px;margin-top:2px}.version{font-size:10px;margin-top:3px}\r\n  .project-status{grid-column:1;grid-row:2;font-size:11px;gap:5px;margin-top:0;min-height:18px}.project-status::before{width:5px;height:5px}\r\n  .header-history{grid-column:2;grid-row:1\/3;border:0;margin:0;padding:0;gap:2px;align-self:start}.header-history button{width:36px;min-height:40px;padding:7px}.header-history button span{display:none}\r\n  .header-actions{grid-column:1\/-1;width:100%;padding:0;gap:8px}.header-actions button{min-height:42px;flex:1;font-size:12px;padding:9px 10px}.header-actions .desktop-save{display:none}\r\n  .siw-nav{font-size:12px;padding:5px 14px;gap:14px}.notice{padding:9px 14px;font-size:12px;margin:0;border-radius:0}\r\n  .workspace{display:flex;flex-direction:column;gap:0;padding:0;align-items:stretch}\r\n  .stage-panel{order:1;width:100%;padding:14px 14px 12px;border:0;border-top:1px solid var(--sd-border);border-bottom:1px solid var(--sd-border);border-radius:0;display:flex;flex-direction:column}\r\n  .stage-top{margin-bottom:11px;gap:8px;flex-wrap:nowrap;align-items:flex-start}.stage-top h2{font-size:15px;margin-bottom:3px}.stage-top .hint{font-size:11px;line-height:1.75}#canvasInfo{font-size:10px;white-space:normal;text-align:right;max-width:96px;line-height:1.5;flex-shrink:0;padding:3px 6px;margin-top:2px}\r\n  .selection-tools{gap:6px;margin-bottom:11px;flex-wrap:nowrap}.segmented{flex:1;gap:1px;padding:3px}.segmented button{flex:1;padding:8px 5px;min-width:0;min-height:38px;gap:4px;font-size:11px}.segmented .button-icon{width:14px;height:14px;flex-basis:14px}.padding-control{font-size:10px;gap:4px;margin-left:0}.padding-control input{width:36px;height:38px;font-size:12px;padding:4px}.padding-control span{display:none}\r\n  .stage-wrap{height:clamp(244px,66vw,370px);padding:16px;flex:0 0 auto;min-height:0;border-radius:9px}.empty-stage{margin:14px;padding:16px 10px;gap:8px;border-radius:8px}.empty-icon{width:54px;height:54px;border-radius:16px;margin:0}.empty-icon svg{width:39px;height:39px}.empty-stage h2{font-size:17px;line-height:1.5;margin:0}.empty-stage p{font-size:11px;line-height:1.8}.empty-stage button{min-height:42px;padding:10px 16px;font-size:12px;margin-top:5px}.empty-stage small{font-size:10px;margin-top:0}\r\n  .selection-actions{margin-top:10px;gap:7px}.selection-actions #selectionInfo{width:100%;font-size:11px}.selection-actions .button-row{width:100%;margin-left:0;gap:6px}.selection-actions button{min-height:42px;padding:9px 10px;font-size:11px}.selection-actions #downloadSelection{flex:1;min-width:0}.selection-actions #clearSelection{display:none}\r\n  #mobilePropertiesToggle{display:inline-flex;min-height:42px;margin-left:auto;padding:9px 10px;background:var(--sd-primary-soft);border-color:#c6d9ff;color:var(--sd-primary);gap:5px;font-size:11px}#mobileCutCount{display:inline-grid;place-items:center;min-width:18px;min-height:18px;padding:1px 4px;border-radius:5px;background:#e2ecff;font-size:10px}\r\n  .siw-app:not([data-mode=&quot;selection&quot;]) .selection-actions{display:flex;margin-top:10px}.siw-app:not([data-mode=&quot;selection&quot;]) .selection-actions #selectionInfo,.siw-app:not([data-mode=&quot;selection&quot;]) .selection-actions .button-row&gt;button:not(#mobilePropertiesToggle){display:none}.siw-app:not([data-mode=&quot;selection&quot;]) .selection-actions .button-row{justify-content:flex-end}\r\n  .selection-advanced{margin-top:7px;padding:0;border:0}.selection-advanced summary{font-size:11px;min-height:32px;padding:5px 0}.selection-advanced .button-row{margin-top:5px}.selection-advanced button{flex:1;font-size:10px;min-height:40px;padding:8px 5px;gap:4px}\r\n  .stage-bottom{margin-top:8px;padding-top:9px;gap:6px}.stage-bottom button{min-height:36px;padding:7px;font-size:11px}.zoom-controls{gap:3px}.zoom-controls span{font-size:10px;min-width:32px}.zoom-controls button:first-child,.zoom-controls button:nth-child(3){min-width:31px;font-size:18px;padding:3px 6px}#showLayers{font-size:10px;gap:4px;padding:7px}\r\n  .tool-rail{order:2;position:sticky;bottom:0;z-index:30;align-self:stretch;display:grid;grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:64px;overflow-x:auto;gap:3px;width:100%;padding:6px 8px calc(6px + env(safe-area-inset-bottom));border:0;border-top:1px solid var(--sd-border);border-radius:0;background:#fff;box-shadow:0 -4px 20px #24385408}.tool-rail .mode-button{font-size:10px;white-space:normal;min-width:0;min-height:60px;padding:7px 1px;gap:6px;border-radius:8px}.tool-rail .mode-button svg{width:22px;height:22px;stroke-width:1.7}.tool-rail .desktop-mode{display:flex}\r\n  .inspector{position:fixed;inset:auto 0 0;z-index:60;max-height:76svh;min-height:0;padding:18px 18px calc(20px + env(safe-area-inset-bottom));border:1px solid #dce4f1;border-bottom:0;border-radius:18px 18px 0 0;box-shadow:0 -12px 45px #20355326;background:#fff;overflow:auto;overscroll-behavior:contain;transform:translateY(105%);transition:transform .2s ease;visibility:hidden;pointer-events:none}.inspector.open{transform:translateY(0);visibility:visible;pointer-events:auto}\r\n  .property-heading{position:sticky;top:-18px;z-index:2;background:#fff;margin:-1px 0 15px;padding:0 0 12px;min-height:44px;align-items:center}.property-heading h2{font-size:16px}.property-heading #propertiesClose{display:inline-flex;min-width:40px;min-height:40px;font-size:24px;padding:4px;border:0;border-radius:50%;background:var(--sd-background);color:var(--sd-text-secondary)}\r\n  .drawer-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:55;background:#21334c70;backdrop-filter:blur(1px)}\r\n  .inspector button{min-height:42px}.selection-queue{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:315px;margin-top:0}.queue-empty{grid-column:1\/-1;min-height:140px;font-size:12px}.queue-card{grid-template-columns:1fr;gap:7px;padding:9px}.queue-thumb{width:100%;height:92px}.queue-name{font-size:12px}.queue-meta&gt;span{font-size:11px}.queue-item-actions{gap:4px;padding-top:1px}.queue-item-actions button{min-height:40px;font-size:10px;padding:7px 4px;gap:3px}.queue-item-actions .danger{min-width:40px}.queue-actions&gt;.primary{min-height:44px;font-size:13px}.queue-actions&gt;.button-row button{min-height:40px;font-size:11px;gap:4px}.queue-actions&gt;.button-row .button-icon{width:14px;height:14px;flex-basis:14px}\r\n  .layer-name{max-width:none}.layer-list{max-height:230px}.layer-buttons button{min-height:40px}.property-group&gt;.button-row button{min-height:44px;font-size:12px}.field input:not([type=range]):not([type=color]),.field select{min-height:42px}.field{font-size:12px}.more-actions{grid-template-columns:1fr 1fr}.more-actions button{font-size:12px;min-height:48px;padding:10px;justify-content:center}.more-actions button:last-child{grid-column:1\/-1}\r\n  .workspace-footer{padding:12px 14px;gap:6px;font-size:11px;flex-wrap:wrap;background:#fff}.downloads{padding:10px;font-size:11px}.downloads p,.downloads a{font-size:11px}\r\n  dialog{padding:20px;width:460px;max-width:calc(100% - 24px);max-height:85svh}.dialog-head h2{font-size:17px}.dialog-actions{gap:7px}.dialog-actions button{min-height:44px;font-size:11px;padding:9px 8px;flex:1}\r\n}\r\n@media(min-width:601px) and (max-width:900px){.siw-header{grid-template-columns:1fr auto auto;align-items:center}.header-actions{grid-column:3;grid-row:1\/3;width:auto;min-width:230px}.header-actions .desktop-save{display:inline-flex}.header-history{grid-column:2}.stage-panel{padding:18px 22px}.stage-wrap{height:380px}.tool-rail{padding-inline:22px}.tool-rail .mode-button{font-size:11px;min-height:65px}.inspector{left:auto;right:0;width:390px;inset-block:0;max-height:none;border-radius:16px 0 0 16px;transform:translateX(105%);border-bottom:1px solid #dce4f1}.inspector.open{transform:translateX(0)}.selection-actions #selectionInfo{width:auto}.selection-actions .button-row{width:auto;margin-left:auto}.selection-actions #clearSelection{display:inline-flex}.empty-stage h2{font-size:21px}.empty-stage p{font-size:13px}.empty-icon{width:72px;height:72px}.empty-icon svg{width:50px;height:50px}}\r\n@media(max-width:360px){.siw-header{padding:12px 10px}.brand{gap:6px}h1{font-size:15px}.brand-mark{width:30px;height:30px;flex-basis:30px}.version{font-size:9px}.stage-panel{padding:12px 10px}.stage-top .hint{font-size:10px}#canvasInfo{max-width:80px;font-size:9px}.segmented button{font-size:10px;padding:8px 3px;gap:3px}.segmented .button-icon{width:13px;height:13px;flex-basis:13px}.padding-control{gap:3px}.padding-control input{width:33px}.stage-wrap{height:245px;padding:12px}.empty-stage{margin:10px;padding:12px 8px;gap:7px}.empty-stage h2{font-size:15px}.empty-stage p{font-size:10px}.empty-icon{width:44px;height:44px;border-radius:13px}.empty-icon svg{width:34px;height:34px}.empty-stage small{font-size:9px}.stage-bottom button{font-size:10px;padding:7px 5px}.zoom-controls{gap:2px}.zoom-controls span{min-width:27px}#showLayers{font-size:9px}.tool-rail{padding-inline:4px;gap:1px}.tool-rail .mode-button{font-size:9px}.inspector{padding-inline:12px}.selection-advanced button{font-size:9px}.workspace-footer{font-size:10px;padding-inline:10px}}\r\n\/* The host supplies its visible iframe rectangle; standalone pages keep normal viewport behavior. *\/\r\n@media(max-width:900px){.tool-rail{bottom:var(--sd-visible-bottom-offset,0px)}.inspector{bottom:var(--sd-visible-bottom-offset,0px);max-height:min(76svh,var(--sd-visible-height,76svh))}.drawer-backdrop:not([hidden]){top:var(--sd-visible-top,0px);bottom:var(--sd-visible-bottom-offset,0px)}}\r\n@media(min-width:601px) and (max-width:900px){.inspector{top:var(--sd-visible-top,0px);max-height:var(--sd-visible-height,100svh)}}\r\n@media(max-width:900px){dialog{position:fixed;top:var(--sd-visible-top,0px);bottom:var(--sd-visible-bottom-offset,0px);max-height:min(85svh,var(--sd-visible-height,85svh));margin:auto}}\r\n\r\n\/* V1.4: shared real brand, work status, predictable creative actions. *\/\r\n.brand-logo{display:block;width:112px;height:38px;object-fit:contain;flex:0 0 112px}.brand-logo[hidden]{display:none}.brand .version{display:none}.siw-header{gap:12px;flex-wrap:wrap}.brand h1{font-size:16px}.brand .header-subtitle{font-size:10px}.member-banner{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 20px;background:linear-gradient(110deg,#eef4ff,#f5f1ff);color:#3c517b;border-bottom:1px solid #dfe7f7;font-size:12px}.member-banner button{min-height:30px;padding:4px 12px;background:#fff;color:#2468eb;border-color:#d6e1ff}.member-banner[data-mode=member]{background:#f3faf8;color:#346852}.member-banner[data-mode=member] button{display:none}.stage-bottom{flex-wrap:wrap}.stage-bottom #compareOriginal{font-size:11px;padding:5px 8px;min-height:32px}.stage-wrap.drag-hover{box-shadow:inset 0 0 0 3px #2468eb;background:#eaf1ff}.stage-wrap.comparing::after{content:&#039;\u539f\u59cb\u56fe\u7247&#039;;position:absolute;top:12px;left:12px;padding:5px 9px;border-radius:6px;background:#202a3be0;color:#fff;font-size:11px;pointer-events:none}.stage-wrap.comparing canvas{cursor:default!important}.empty-stage #tryDemo{margin-top:8px;background:#fff;border-color:#dce4f1;color:#486283}.more-actions button{justify-content:flex-start}.header-actions #siteAssets{color:#2468eb;background:#f4f7ff}.siw-app.busy .header-actions button{cursor:wait}.member-banner[data-mode=trial] #memberLabel::before{content:&#039;\u2726 &#039;;color:#7660c9}\r\n@media(min-width:901px){\r\n  .siw-header .project-status{order:2;flex-basis:100%;margin-top:-9px;font-size:11px}\r\n  .workspace{grid-template-columns:74px 286px minmax(0,1fr);grid-template-rows:minmax(0,1fr);height:650px;min-height:0;align-items:stretch}\r\n  .workspace&gt;.inspector{height:100%;max-height:100%;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;align-self:stretch;scrollbar-gutter:stable}\r\n  .workspace&gt;.tool-rail{height:100%;max-height:100%;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;align-self:stretch}\r\n  .workspace&gt;.tool-rail .mode-button{flex:0 0 auto}\r\n  .workspace&gt;.stage-panel{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}\r\n  .stage-top,.stage-bottom,.selection-tools,.selection-actions,.selection-advanced{flex:0 0 auto}\r\n  .stage-wrap{height:auto;min-height:0;max-height:none;flex:1 1 0;overflow:auto}\r\n}\r\n@media(min-width:901px) and (max-width:1190px){.workspace{height:560px}}\r\n@media(max-width:900px){.brand-logo{width:95px;flex-basis:95px;height:31px}.siw-header{padding:12px 14px;gap:9px}.brand{gap:7px}.brand h1{font-size:14px}.brand .header-subtitle{display:none}.header-history{margin-left:auto}.header-actions{width:100%;display:flex}.header-actions button{flex:1;padding:8px 5px;font-size:11px;min-height:39px}.member-banner{padding:7px 13px;font-size:11px}.member-banner button{font-size:11px;white-space:nowrap}.stage-bottom #compareOriginal{font-size:10px}.stage-wrap{height:clamp(255px,calc(100svh - 400px),500px)}.tool-rail .mode-button{font-size:10px;min-height:64px}.project-status{max-width:100%;white-space:normal}.empty-stage h2{font-size:17px}.empty-stage p{font-size:12px;line-height:1.7}.empty-stage #tryDemo{min-height:33px}.stage-bottom{gap:6px}}\r\n\r\n\/* BEGIN SHANDE_LAYOUT_V3 \u2014 one shell, contextual tools, unobstructed canvas. *\/\r\n.siw-app{background:#eef1f5;color:#283448}\r\n.siw-header{display:flex;align-items:center;flex-wrap:nowrap;min-height:56px;margin:0;padding:9px 14px;gap:12px;background:#fff;border:0;border-bottom:1px solid #dfe4ec;border-radius:0}\r\n.siw-header&gt;.brand{display:none}\r\n.siw-header .sd-file-left{display:flex;flex:0 0 auto;align-items:center;gap:7px;min-width:0}\r\n.siw-header .header-history{display:flex;gap:2px;margin:0 0 0 4px;padding:0 0 0 9px;border:0;border-left:1px solid #e5e9ef}\r\n.siw-header button,.siw-header .header-actions button{height:36px;min-height:36px;min-width:0;padding:7px 10px;gap:6px;border:1px solid #e0e5ed;border-radius:6px;background:#fff;color:#39465a;font-size:12px;white-space:nowrap;flex:0 0 auto}\r\n.siw-header .header-history button{width:32px;min-width:32px;padding:7px;border-color:transparent;background:transparent}\r\n.siw-header .header-history button span{display:none}\r\n.siw-header button:hover{background:#f3f6fb;border-color:#c9d7eb}\r\n.siw-header button.primary{background:#2468eb;border-color:#2468eb;color:white}\r\n.siw-header button.primary:hover{background:#1957cf}\r\n.siw-header .action-compact{display:none}\r\n.siw-header&gt;.project-status{order:0;flex:1 1 130px;min-width:0;max-width:none;margin:0;font-size:11px;color:#7b8596;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\r\n.siw-header&gt;.header-actions.header-end{display:flex;flex:0 0 auto;flex-wrap:nowrap;align-items:center;gap:7px;min-width:0;width:auto;padding:0;margin-left:auto}\r\n.siw-header .header-actions .desktop-save{display:inline-flex}\r\n.siw-header .member-account{display:flex;flex-direction:row;align-items:center;gap:0;white-space:nowrap;max-width:130px}\r\n.siw-header #memberLabel,.stage-top #modeTitle{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\r\n.siw-header #membershipAction{border:0;padding:7px 3px;color:#68768c;background:transparent;font-size:11px}\r\n.siw-header #focusWorkspace{border-color:transparent;color:#617087;background:transparent}\r\n.siw-header #focusWorkspace[aria-pressed=true]{background:#edf3ff;color:#2468eb}\r\n.workspace-auxiliary{display:none}\r\n.member-badge{display:inline-flex;align-items:center;flex:0 0 auto;color:#7c5b24;background:#fff5dc;border:1px solid #f0dfb8;font-size:10px;line-height:1.2;font-weight:500;padding:2px 5px;border-radius:4px;white-space:nowrap}\r\n.workspace{padding:0;gap:0;background:#eef1f5}\r\n.tool-rail{border:0;border-right:1px solid #e1e6ee;border-radius:0;background:#f9fafc;padding:10px 6px;gap:4px}\r\n.tool-rail .mode-button{position:relative;min-height:60px;padding:8px 2px;gap:5px;border:0;border-radius:7px;background:transparent;font-size:11px;color:#6a7485}\r\n.tool-rail .mode-button svg{width:21px;height:21px;stroke-width:1.65}\r\n.tool-rail .mode-button.active{background:#eaf1ff;color:#2468eb;font-weight:600}\r\n.tool-rail .mode-button.active::before{content:&#039;&#039;;position:absolute;left:-6px;top:14px;bottom:14px;width:3px;border-radius:0 3px 3px 0;background:#2468eb}\r\n.inspector{border:0;border-right:1px solid #dfe4ec;border-radius:0;background:#fff;padding:0 16px 18px}\r\n.property-heading{position:sticky;top:0;z-index:4;background:#fff;min-height:51px;padding:12px 0;margin:0 0 14px;border-bottom:1px solid #edf0f5;align-items:center}\r\n.property-heading h2{font-size:14px;font-weight:600;letter-spacing:.2px}\r\n.inspector .field{gap:6px;margin:12px 0;font-size:12px;color:#5d6a7c}\r\n.inspector .field input:not([type=range]):not([type=color]),.inspector .field select,.inspector .field textarea{min-height:34px;padding:7px 8px;border-radius:5px;border-color:#e0e5ec;font-size:12px}\r\n.inspector .field input[type=color]{height:34px;border-radius:5px}\r\n.inspector .field input[type=range]{min-height:20px}\r\n.inspector .field textarea{min-height:72px}\r\n.inspector button{min-height:34px;padding:7px 9px;border-radius:5px;font-size:12px}\r\n.inspector .hint{font-size:11px;line-height:1.65;color:#8791a1;margin:8px 0 12px}\r\n.inspector .check{font-size:11px;margin:10px 0;color:#68758a}\r\n.inspector .divider{margin:16px 0;border-color:#edf0f4}\r\n.inspector .property-group{margin-bottom:17px}\r\n.inspector .property-group&gt;.button-row{gap:6px}\r\n.inspector .property-group&gt;.button-row button{min-height:34px;font-size:11px}\r\n.inspector .style-details,.inspector .layers-details{margin-top:14px}\r\n.inspector #morePanel&gt;h2{display:none}\r\n.stage-panel{background:#eef1f5;border:0;border-radius:0;padding:12px 16px 10px;min-width:0}\r\n.stage-top{display:flex;flex-wrap:nowrap;align-items:center;gap:12px;margin-bottom:10px;min-height:25px}\r\n.stage-top&gt;div{min-width:0;flex:1}\r\n.stage-top .hint{font-size:11px;line-height:1.6;color:#8992a0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}\r\n#canvasInfo{padding:3px 0;background:none;border-radius:0;color:#7d8796;font-size:11px;line-height:1.4;white-space:nowrap}\r\n.stage-wrap{border:0;border-radius:0;background:#e9edf2;padding:24px;box-shadow:inset 0 0 0 1px #e2e7ee}\r\n.stage-wrap canvas{box-shadow:0 5px 22px #202d421c}\r\n.stage-bottom{border:0;padding-top:9px;margin-top:0;gap:8px}\r\n.stage-bottom button,.stage-bottom #compareOriginal{border-color:transparent;background:transparent;min-height:32px;padding:6px 7px;color:#738096;font-size:11px;border-radius:5px}\r\n.stage-bottom button:hover{color:#2468eb;background:#fff}\r\n.stage-bottom .zoom-controls{background:#fff;border:1px solid #dfe5ee;border-radius:6px;gap:0}\r\n.stage-bottom .zoom-controls button{min-height:30px}\r\n.stage-bottom .zoom-controls span{min-width:45px;color:#59677c}\r\n.selection-tools{margin-bottom:10px}\r\n.selection-actions{margin-top:9px}\r\n.selection-advanced{margin-top:6px}\r\n.empty-stage{margin:0;inset:0;padding:28px;border:0;border-radius:0;background:#f2f4f8;gap:10px;overflow:auto}\r\n.empty-stage .empty-icon{width:62px;height:62px;border-radius:18px;background:#e8effd;margin:0 0 2px}\r\n.empty-stage .empty-icon svg{width:43px;height:43px;stroke-width:2}\r\n.empty-stage h2{font-size:21px;line-height:1.5;font-weight:600;color:#2d3a50}\r\n.empty-stage p{font-size:12px;line-height:1.7;color:#8791a2}\r\n.start-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:min(420px,100%);margin:12px 0 2px}\r\n.empty-stage .start-options button{display:grid;grid-template-columns:32px 1fr;grid-template-rows:auto auto;gap:4px 12px;align-items:center;justify-content:start;min-height:84px;margin:0;padding:17px;text-align:left;border:1px solid #dce4f0;border-radius:10px;background:#fff;box-shadow:0 2px 5px #1b305206;color:#3d506e}\r\n.empty-stage .start-options button:hover{border-color:#8fafe5;background:#fcfdff;box-shadow:0 5px 15px #294d8a0d}\r\n.empty-stage .start-options .button-icon{grid-row:1\/3;width:30px;height:30px;stroke-width:1.45;color:#5681c5}\r\n.empty-stage .start-options strong{font-size:13px;font-weight:600;line-height:1.5}\r\n.empty-stage .start-options span{font-size:10px;color:#939cad;line-height:1.5}\r\n.empty-stage #tryDemo{min-height:30px;margin:0;padding:4px 8px;border:0;background:transparent;color:#5e7aab;font-size:11px}\r\n.empty-stage small{font-size:10px;color:#9aa4b4;margin:0}\r\n@media(min-width:901px){\r\n .workspace{grid-template-columns:72px 280px minmax(0,1fr);height:650px;grid-template-rows:minmax(0,1fr)}\r\n .workspace&gt;.tool-rail,.workspace&gt;.inspector,.workspace&gt;.stage-panel{height:100%;max-height:100%;min-height:0;align-self:stretch}\r\n .workspace&gt;.tool-rail,.workspace&gt;.inspector{overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-gutter:auto}\r\n .workspace&gt;.stage-panel{display:flex;flex-direction:column;overflow:hidden}\r\n .stage-wrap{height:auto;min-height:0;max-height:none;flex:1 1 0;overflow:auto}\r\n}\r\n@media(min-width:1450px){.workspace{grid-template-columns:76px 300px minmax(0,1fr);height:700px}.inspector{padding-inline:20px}.stage-panel{padding:14px 22px 12px}}\r\n@media(min-width:901px) and (max-width:1100px){.workspace{grid-template-columns:68px 260px minmax(0,1fr);height:610px}.siw-header{padding-inline:10px;gap:8px}.siw-header .action-wide{display:none}.siw-header .action-compact{display:inline}.siw-header #focusLabel{display:none}.siw-header&gt;.project-status{flex-basis:80px}.stage-panel{padding-inline:12px}}\r\n@media(max-width:900px){\r\n .siw-header{display:flex;flex-wrap:nowrap;padding:8px 10px;gap:8px;min-height:54px}\r\n .siw-header .sd-file-left{flex:0 0 auto;width:auto;gap:5px}\r\n .siw-header .header-history{padding-left:5px;margin-left:0}\r\n .siw-header&gt;.project-status{flex:1 1 65px;width:auto;max-width:none;margin:0;font-size:10px}\r\n .siw-header&gt;.header-actions.header-end{width:auto;min-width:0;flex:0 0 auto;gap:5px;order:0}\r\n .siw-header button,.siw-header .header-actions button{min-height:36px;height:36px;padding:7px 8px;font-size:11px}\r\n .siw-header .action-wide{display:none}.siw-header .action-compact{display:inline}\r\n .siw-header #focusLabel{display:none}\r\n .siw-header .member-account{display:flex}\r\n .workspace{display:flex;padding:0;gap:0}\r\n .stage-panel{padding:10px 12px 8px;min-height:0}\r\n .stage-top{margin-bottom:7px;gap:8px;min-height:20px}\r\n .stage-top .hint{font-size:10px;line-height:1.6;-webkit-line-clamp:1}\r\n #canvasInfo{font-size:10px;max-width:none}\r\n .stage-wrap{height:clamp(280px,64vw,420px);min-height:0;padding:16px;flex:0 0 auto}\r\n .stage-bottom{padding-top:7px;gap:4px;flex-wrap:nowrap}\r\n .stage-bottom button,.stage-bottom #compareOriginal{min-height:32px;padding:5px;font-size:10px}\r\n .stage-bottom .zoom-controls span{min-width:33px;font-size:10px}\r\n .tool-rail{border:0;border-top:1px solid #dfe5ee;border-radius:0;background:#fff;padding:5px 8px calc(5px + env(safe-area-inset-bottom));gap:3px;grid-auto-columns:62px;box-shadow:none;min-height:0}\r\n .tool-rail .mode-button{min-height:56px;padding:6px 1px;gap:4px;font-size:10px}\r\n .tool-rail .mode-button svg{width:20px;height:20px}\r\n .tool-rail .mode-button.active::before{display:none}\r\n .inspector{padding:0 16px calc(16px + env(safe-area-inset-bottom));height:min(46svh,390px);max-height:min(46svh,var(--sd-visible-height,46svh));border:1px solid #dbe2ed;border-bottom:0;border-radius:14px 14px 0 0;box-shadow:0 -5px 24px #22334d1a}\r\n .property-heading{top:0;min-height:48px;padding:9px 0;margin:0 0 12px}\r\n .property-heading h2{font-size:14px}\r\n .property-heading #propertiesClose{min-width:30px;min-height:30px;width:30px;height:30px;padding:0;border-radius:6px;background:#f2f4f8;font-size:22px}\r\n .inspector button{min-height:38px}\r\n .drawer-backdrop:not([hidden]){background:#2035530a;backdrop-filter:none}\r\n .empty-stage{padding:18px 15px;gap:7px}\r\n .empty-stage .empty-icon{width:48px;height:48px;border-radius:14px}.empty-stage .empty-icon svg{width:34px;height:34px}\r\n .empty-stage h2{font-size:18px}.empty-stage p{font-size:11px}\r\n .start-options{margin:7px 0 0;gap:9px;max-width:370px}\r\n .empty-stage .start-options button{min-height:76px;padding:12px;gap:3px 9px;grid-template-columns:25px 1fr}\r\n .empty-stage .start-options .button-icon{width:25px;height:25px}\r\n .empty-stage .start-options strong{font-size:12px}.empty-stage .start-options span{font-size:9px}\r\n}\r\n@media(min-width:601px) and (max-width:900px){\r\n .inspector{left:auto;right:0;top:var(--sd-visible-top,0px);bottom:var(--sd-visible-bottom-offset,0px);width:min(340px,44vw);height:auto;max-height:var(--sd-visible-height,100svh);border-radius:0;border-bottom:1px solid #dbe2ed;transform:translateX(105%)}\r\n .inspector.open{transform:translateX(0)}\r\n .siw-app.properties-open .stage-panel{padding-right:calc(min(340px,44vw) + 12px)}\r\n .siw-app.properties-open .stage-bottom{flex-wrap:wrap}\r\n .siw-app.properties-open .stage-bottom #compareOriginal{display:none}\r\n}\r\n@media(max-width:600px){\r\n .siw-header{display:grid;grid-template-columns:minmax(0,1fr);gap:5px;padding:7px 10px}\r\n .siw-header .sd-file-left{grid-column:1;grid-row:1;width:100%;justify-content:flex-start}\r\n .siw-header .header-history{margin-left:auto}\r\n .siw-header&gt;.header-actions.header-end{grid-column:1;grid-row:2;width:100%;justify-content:flex-end;gap:6px}\r\n .siw-header .member-account{margin-right:auto}\r\n .siw-header&gt;.project-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;max-width:1px}\r\n .siw-header #focusLabel{display:inline}\r\n .siw-header #newCanvas,.siw-header #importBtn{font-size:12px}\r\n .siw-header #membershipAction{font-size:11px}\r\n .siw-header .header-actions #saveProject{display:inline-flex}\r\n .inspector{left:0;right:0;top:auto;bottom:var(--sd-visible-bottom-offset,0px);width:auto;transform:translateY(105%)}\r\n .inspector.open{transform:translateY(0)}\r\n .stage-panel{padding-inline:10px}\r\n .stage-bottom #showLayers{font-size:0;gap:0;padding:5px 8px}.stage-bottom #showLayers .button-icon{width:17px;height:17px}\r\n .empty-stage small{font-size:9px}\r\n}\r\n\/* Focus uses an explicitly sized host shell; normal iframe height remains content-driven. *\/\r\nhtml.siw-focus,html.siw-focus body{height:100%;overflow:hidden}\r\nhtml.siw-focus .siw-app{height:100%;display:flex;flex-direction:column;overflow:hidden}\r\nhtml.siw-focus .siw-header,html.siw-focus .notice,html.siw-focus .siw-font-notice{flex:0 0 auto}\r\nhtml.siw-focus .workspace{flex:1 1 0;height:auto;min-height:0;overflow:hidden}\r\nhtml.siw-focus .stage-panel{min-height:0;overflow:hidden}\r\nhtml.siw-focus .stage-wrap{height:auto;min-height:0;flex:1 1 0}\r\n@media(max-width:900px){html.siw-focus .workspace{display:flex}html.siw-focus .stage-panel{flex:1 1 0}html.siw-focus .tool-rail{position:relative;bottom:auto;flex:0 0 auto}html.siw-focus .inspector{bottom:0}}\r\n\/* SHANDE_MOBILE_FOCUS_BUDGET_V3: the preview keeps space on short phones. *\/\r\n@media(max-width:600px){\r\n html.siw-focus{--siw-mobile-sheet-height:min(42svh,320px)}\r\n html.siw-focus .siw-app.properties-open .workspace{padding-bottom:var(--siw-mobile-sheet-height)}\r\n html.siw-focus .siw-app.properties-open .inspector{height:var(--siw-mobile-sheet-height);max-height:var(--siw-mobile-sheet-height)}\r\n html.siw-focus .siw-app.properties-open .tool-rail,\r\n html.siw-focus .siw-app.properties-open .stage-top,\r\n html.siw-focus .siw-app.properties-open .selection-tools,\r\n html.siw-focus .siw-app.properties-open .selection-actions,\r\n html.siw-focus .siw-app.properties-open .stage-panel&gt;.selection-advanced{display:none}\r\n html.siw-focus .siw-app.properties-open .stage-panel{padding:8px 10px}\r\n html.siw-focus .siw-app.properties-open .stage-wrap{padding:8px;min-height:112px}\r\n html.siw-focus .siw-app.properties-open .stage-bottom{padding-top:4px}\r\n}\r\n@media(max-width:600px) and (max-height:600px){\r\n html.siw-focus .siw-app.properties-open .siw-header{display:flex;min-height:44px;padding:4px 8px;gap:6px}\r\n html.siw-focus .siw-app.properties-open .siw-header .sd-file-left{width:auto;flex:0 0 auto}\r\n html.siw-focus .siw-app.properties-open .siw-header .header-history{margin:0;padding:0;border:0}\r\n html.siw-focus .siw-app.properties-open .siw-header&gt;.header-actions.header-end{width:auto;flex:1 1 0;gap:5px;justify-content:flex-end}\r\n html.siw-focus .siw-app.properties-open #newCanvas,\r\n html.siw-focus .siw-app.properties-open #importBtn,\r\n html.siw-focus .siw-app.properties-open #saveProject,\r\n html.siw-focus .siw-app.properties-open .member-account,\r\n html.siw-focus .siw-app.properties-open .stage-bottom{display:none}\r\n html.siw-focus .siw-app.properties-open .notice{max-height:40px;overflow:auto;padding:5px 10px;font-size:11px;line-height:1.5}\r\n html.siw-focus .siw-app.properties-open .siw-font-notice{max-height:54px;overflow:auto;padding:5px 10px;font-size:11px}\r\n}\r\n\/* END SHANDE_MOBILE_FOCUS_BUDGET_V3 *\/\r\n\/* SHANDE_MOBILE_CLOSED_BUDGET_V3: reserve preview space without forcing overflow. *\/\r\n@media(max-width:600px) and (max-height:600px){\r\n html.siw-focus .siw-app:not([data-mode=&quot;selection&quot;]) .selection-actions{display:none}\r\n html.siw-focus .stage-top{display:none}\r\n html.siw-focus .tool-rail{grid-auto-columns:max-content;gap:4px;padding:4px 7px calc(4px + env(safe-area-inset-bottom));scrollbar-width:none;overflow-y:hidden}\r\n html.siw-focus .tool-rail::-webkit-scrollbar{display:none;width:0;height:0}\r\n html.siw-focus .tool-rail .mode-button{min-height:40px;padding:7px 9px;flex-direction:row;gap:5px;font-size:11px;white-space:nowrap}\r\n html.siw-focus .tool-rail .mode-button svg{width:18px;height:18px;flex:0 0 18px}\r\n html.siw-focus .siw-app:not(.properties-open) .stage-panel{padding:8px 10px}\r\n html.siw-focus .siw-app:not(.properties-open) .stage-wrap{padding:8px}\r\n html.siw-focus .siw-app:not(.properties-open) .stage-bottom{margin-top:0;padding-top:4px;flex:0 0 auto}\r\n html.siw-focus #notice{max-height:32px;overflow:auto;padding:5px 10px;font-size:11px;line-height:1.5}\r\n html.siw-focus #notice.error{max-height:48px}\r\n html.siw-focus .siw-font-notice{max-height:54px;overflow:auto;padding:5px 10px;font-size:11px}\r\n html.siw-focus .stage-panel&gt;#downloads{max-height:64px;overflow:auto;margin-top:4px;padding:5px 8px;font-size:11px}\r\n html.siw-focus .siw-app.compact-selection:not(.properties-open) .selection-tools{flex:0 0 auto;flex-wrap:nowrap;gap:8px;margin:0 0 5px}\r\n html.siw-focus .siw-app.compact-selection .selection-tools .segmented{flex:1 1 auto;padding:2px;gap:2px}\r\n html.siw-focus .siw-app.compact-selection .selection-tools .segmented button{flex:1 1 0;min-height:32px;padding:6px;font-size:0;gap:0}\r\n html.siw-focus .siw-app.compact-selection .selection-tools .segmented .button-icon{width:18px;height:18px;flex:0 0 18px}\r\n html.siw-focus .siw-app.compact-selection .selection-tools #mobilePropertiesToggle{display:inline-flex;margin:0;min-height:34px;padding:6px 8px;font-size:11px;flex:0 0 auto}\r\n html.siw-focus .siw-app.compact-selection .selection-actions{display:none}\r\n html.siw-focus .selection-mobile-dock{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:15px;padding-bottom:12px;border-bottom:1px solid #edf0f5}\r\n html.siw-focus .selection-mobile-dock .padding-control{width:100%;justify-content:space-between;margin:0}\r\n html.siw-focus .selection-mobile-dock .padding-control input{width:76px;height:36px}\r\n html.siw-focus .selection-mobile-dock .padding-control span{display:inline}\r\n html.siw-focus .selection-mobile-dock #downloadSelection,html.siw-focus .selection-mobile-dock #clearSelection{display:inline-flex;min-height:38px;font-size:11px}\r\n html.siw-focus .selection-mobile-dock .selection-advanced{width:100%;margin:0}\r\n html.siw-focus .selection-mobile-dock .selection-advanced .button-row{display:grid;gap:6px;grid-template-columns:1fr}\r\n}\r\n\/* END SHANDE_MOBILE_CLOSED_BUDGET_V3 *\/\r\n\r\n@media(prefers-reduced-motion:reduce){.inspector{transition:none}}\r\n\/* END SHANDE_LAYOUT_V3 *\/\r\n\/* Original Shande material\/font panels: shared native authorization, contextual left tools. *\/\r\n.siw-library-search{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;margin:12px 0}.siw-library-search input,.siw-library-search select{min-width:0;width:100%;border:1px solid var(--sd-border);background:#fff;border-radius:7px;padding:9px;font:inherit}.siw-library-search select{grid-column:1\/-1}.siw-library-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.siw-library-card{min-width:0;padding:8px;border:1px solid var(--sd-border);border-radius:9px;display:flex;flex-direction:column;gap:7px;background:#fff}.siw-library-card img{display:block;width:100%;height:100px;object-fit:contain;border-radius:5px;background:#f4f6f9}.siw-library-card strong{font-size:12px;line-height:1.6;overflow-wrap:anywhere}.siw-library-card small,.siw-library-card a{font-size:11px;line-height:1.5}.siw-library-card a{color:var(--sd-primary)}.siw-library-card select{min-width:0;width:100%;font:inherit;font-size:11px;border:1px solid var(--sd-border);border-radius:6px;padding:7px}.inspector .siw-library-card button{min-height:34px;padding:7px 4px;font-size:11px;margin-top:auto}.siw-library-pages{display:flex;justify-content:center;align-items:center;gap:10px;margin:12px 0}.siw-library-pages span{font-size:12px;min-width:20px;text-align:center}.siw-library-footnote{font-size:11px}.siw-site-fonts{border-top:1px solid var(--sd-border);padding-top:12px;margin:14px 0}.siw-site-fonts&gt;summary{font-weight:600;cursor:pointer;min-height:32px}.siw-font-grid{display:grid;gap:8px}.siw-font-grid .siw-library-card{display:grid;grid-template-columns:1fr auto}.siw-font-grid .siw-library-card strong,.siw-font-grid .siw-library-card select,.siw-font-grid .siw-library-card small{grid-column:1\/-1}.siw-font-grid .siw-library-card img{display:none}.siw-font-grid .siw-library-card button{margin-top:0}.siw-font-notice{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 18px;background:#fff8e9;border-bottom:1px solid #eedbae;color:#80540c;font-size:12px;line-height:1.7}.siw-font-notice[hidden]{display:none}.siw-font-notice button{font:inherit;border:1px solid #cfa954;border-radius:6px;background:#fff;padding:7px 10px;color:#80540c;cursor:pointer}.siw-library-empty{grid-column:1\/-1;border:1px dashed var(--sd-border);border-radius:8px;padding:18px 12px;text-align:center;color:var(--sd-muted);font-size:12px;line-height:1.8}\r\n\r\n\/* Canvas manipulation controls, scoped to the native image workspace. *\/\r\n.canvas-selection-tools{border-top:1px solid #e5eaf2;padding-top:12px;margin-top:12px}.canvas-selection-tools&gt;.button-row{gap:5px}.canvas-selection-tools button{flex:1;padding:7px 8px}.canvas-align-tools{margin:12px 0}.canvas-align-tools summary{cursor:pointer;min-height:28px;font-size:12px;color:#526380}.canvas-align-tools .grid2{gap:6px}.layer-quick-actions{display:flex;flex-direction:column;gap:3px}.layer-quick-actions button{font-size:10px;min-height:24px;min-width:27px;padding:2px 4px}.layer-card.locked{background:#f5f6f8}.layer-card.dragging{opacity:.5}.layer-card.drop-target{box-shadow:inset 0 3px #2468eb}.canvas-inline-text{position:fixed;z-index:10000;margin:0;padding:0;border:1px solid #2468eb;border-radius:0;background:rgba(255,255,255,.97);resize:none;outline:2px solid #2468eb33;transform-origin:50% 50%;overflow:auto;box-sizing:border-box;white-space:pre-wrap;overflow-wrap:anywhere;min-height:0;min-width:0;box-shadow:0 2px 12px #21335222}\r\n\r\n\/* SD_GRID_SLICES_V1 *\/\r\n.grid-details[open]{padding-bottom:12px}.grid-details .field{margin-top:10px}.grid-preview{display:block;width:100%;height:auto;max-height:190px;object-fit:contain;margin-top:12px;border:1px solid #dce5f1;border-radius:8px;background:repeating-conic-gradient(#edf1f6 0 25%,#fff 0 50%) 0 0\/16px 16px}.grid-preview[hidden]{display:none}.grid-details #splitPreviewInfo{font-variant-numeric:tabular-nums}.grid-details select{width:100%}\r\n\/* BEGIN SHANDE_VECTOR_STYLE_V1 *\/\r\n#vectorDialog{width:760px;max-width:calc(100% - 24px)}\r\n#vectorDialog .vector-options{display:grid;grid-template-columns:1.5fr 1fr 1fr;gap:12px}\r\n#vectorDialog .vector-preview-pair{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}\r\n#vectorDialog figure{margin:0;min-width:0}\r\n#vectorDialog figcaption{font-size:12px;color:#637087;margin-bottom:6px}\r\n#vectorDialog .vector-preview-surface{height:220px;display:flex;align-items:center;justify-content:center;border:1px solid #dbe3ef;border-radius:8px;overflow:hidden;background-color:#fff;background-image:linear-gradient(45deg,#eef1f5 25%,transparent 25%),linear-gradient(-45deg,#eef1f5 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#eef1f5 75%),linear-gradient(-45deg,transparent 75%,#eef1f5 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}\r\n#vectorDialog .vector-preview-surface img{display:block;width:100%;height:100%;object-fit:contain}\r\n#vectorDialog img[hidden],#vectorDialog button[hidden]{display:none}\r\n#vectorStatus{min-height:38px;margin-top:12px}\r\n#vectorStatus.error{color:#b42318}\r\n.vector-tools{margin-top:18px}\r\n@media(max-width:600px){#vectorDialog .vector-options{grid-template-columns:1fr 1fr;gap:8px}#vectorDialog .vector-options .field:first-child{grid-column:1\/-1}#vectorDialog .vector-preview-pair{gap:8px}#vectorDialog .vector-preview-surface{height:150px}#vectorDialog .dialog-actions{flex-wrap:wrap}}\r\n\/* END SHANDE_VECTOR_STYLE_V1 *\/\r\n\r\n\/* SD_EDITABLE_DESIGN_V3 *\/\r\n.design-template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}.design-template-card{min-width:0;padding:7px;border:1px solid #dce5ef;border-radius:10px;background:#fff}.design-template-card canvas{display:block;width:100%;height:auto;border-radius:5px}.design-template-card strong{display:block;font-size:12px;line-height:1.5;margin:7px 0 5px;overflow-wrap:anywhere}.design-template-card button{width:100%;padding:6px;min-height:30px;font-size:11px}.design-template-card small{display:block;color:#6b7890;font-size:10px;margin-bottom:7px}.design-layout-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:10px 0}.design-layout-grid button{display:flex;flex-direction:column;gap:5px;align-items:center;padding:5px;font-size:10px;min-width:0;border-radius:8px}.design-layout-grid button.active{background:#edf4ff;border-color:#86acf1;color:#185cdc}.design-layout-grid canvas{width:100%;height:47px;object-fit:contain}.design-text-styles{display:grid;grid-template-columns:1fr 1fr;gap:6px}.design-text-combos{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:9px}.design-text-combos button{min-height:68px;padding:9px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;background:#f8faff}.design-text-combos strong{font-size:14px}.design-text-combos small{font-size:10px;color:#657490;margin-top:4px}#collageCellDetails .field{margin-top:9px}#collagePanel select,#templatePanel select,#templatePanel input{width:100%}\r\n&lt;\/style&gt;&lt;style id=&quot;sd-material-fusion&quot;&gt;.siw-library-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:6px 0 12px;font-size:11px;color:var(--sd-muted)}.siw-library-toolbar button{min-height:30px;padding:5px 8px;font-size:11px}.siw-library-badges{display:flex;gap:4px;flex-wrap:wrap;font-size:10px}.siw-library-badge{border-radius:4px;padding:3px 5px;background:#f2f4f7;color:#596579}.siw-library-badge[data-ready=true]{background:#e9f6ef;color:#267149}.siw-library-meta{font-size:10px;color:var(--sd-muted);overflow-wrap:anywhere}.siw-library-card .siw-product-link{min-height:28px;font-size:11px;padding:4px;color:var(--sd-primary)}#imagePackageDialog{width:620px}.siw-package-list{display:grid;gap:7px;max-height:50svh;overflow:auto;margin:12px 0}.siw-package-item{display:grid;grid-template-columns:20px minmax(0,1fr) auto;gap:8px;align-items:center;padding:9px;border:1px solid var(--sd-border);border-radius:7px}.siw-package-item label{min-width:0;overflow-wrap:anywhere;font-size:12px;line-height:1.5}.siw-package-item small{display:block;color:var(--sd-muted);font-size:10px}.siw-package-item button{min-height:30px;padding:5px 7px;font-size:11px}.siw-package-item input{accent-color:var(--sd-primary)}#imagePackageStatus{margin:8px 0;font-size:12px}#assetCategory{font-weight:600}&lt;\/style&gt;&lt;style id=&quot;sd-refine-v3&quot;&gt;.selection-refine{display:flex;align-items:end;gap:8px;flex-wrap:wrap;margin-bottom:10px}.selection-refine .field{margin:0;max-width:170px}.selection-refine .check{font-size:11px}.selection-refine input[type=number]{width:75px}.siw-app:not([data-mode=selection]) .selection-refine{display:none}#queueSelection{display:inline-flex}.queue-name{width:100%;min-width:0;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--sd-text);font:inherit;font-weight:600;padding:4px}.queue-name:hover,.queue-name:focus{border-color:#bed2f5;background:white}.asset-preview-canvas{max-width:100%;height:auto;max-height:55svh;object-fit:contain;background:repeating-conic-gradient(#edf0f4 0% 25%,white 0% 50%) 50%\/16px 16px}.library-chip-row{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0 12px}.library-chip-row button{min-height:28px;padding:4px 9px;font-size:11px;border-radius:16px}.siw-library-card img{cursor:zoom-in;aspect-ratio:1;object-fit:contain;background:repeating-conic-gradient(#f1f3f7 0% 25%,white 0% 50%) 50%\/14px 14px}.font-specimen{width:100%;font-size:22px;line-height:1.4;padding:12px 4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.font-variant-grid{display:grid;gap:7px}.font-variant{display:flex;flex-direction:column;text-align:left;align-items:start;width:100%;padding:10px}.font-variant small{font-size:10px;color:#708095}.font-variant[aria-pressed=true]{border-color:#2468eb;background:#eef4ff}@media(max-width:900px){.selection-refine{gap:5px}.selection-refine .field{max-width:125px;font-size:10px}.selection-refine .check{font-size:10px}.selection-refine button{font-size:10px}}\/* All rules are scoped to the image tool panel. *\/\r\n#tab-image .retouch-compare{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0 8px}\r\n#tab-image .retouch-compare figure{margin:0;min-width:0;text-align:center}\r\n#tab-image .retouch-compare .retouch-thumb{height:100px;border:1px solid #e0e5ec;border-radius:8px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:repeating-conic-gradient(#edf0f4 0 25%,#fff 0 50%) 50%\/12px 12px}\r\n#tab-image .retouch-compare canvas{max-width:100%;max-height:100%;object-fit:contain}\r\n#tab-image .retouch-compare figcaption{font-size:12px;color:#68758a;margin-top:5px}\r\n#tab-image .retouch-adjust-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;align-items:center}\r\n#tab-image .retouch-adjust-row .field{min-width:0}\r\n#tab-image .retouch-adjust-row .retouch-reset{padding:5px 8px;font-size:12px;align-self:center;min-height:30px}\r\n#tab-image [data-image-part=&quot;brush&quot;] .button-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}\r\n#tab-image #retouchSoftSettings .field output,#tab-image #retouchBlurField output{float:right;color:#68758a}\r\n#tab-image #retouchColorField input{width:100%;min-height:34px}\r\n\r\n&lt;\/style&gt;&lt;\/head&gt;&lt;body&gt;&lt;main id=&quot;app&quot; class=&quot;siw-app&quot; data-mode=&quot;edit&quot;&gt;\r\n&lt;header class=&quot;siw-header sd-workspace-filebar&quot;&gt;&lt;div class=&quot;brand&quot;&gt;&lt;img id=&quot;brandLogo&quot; class=&quot;brand-logo&quot; alt=&quot;\u95ea\u5f97\u7d20\u6750&quot; hidden&gt;&lt;div&gt;&lt;h1&gt;\u56fe\u7247\u5de5\u4f5c\u53f0&lt;\/h1&gt;&lt;span class=&quot;header-subtitle&quot;&gt;\u95ea\u5f97\u7d20\u6750 \u00b7 \u672c\u673a\u521b\u4f5c&lt;\/span&gt;&lt;\/div&gt;&lt;span class=&quot;version&quot;&gt;V3.0&lt;\/span&gt;&lt;\/div&gt;&lt;div class=&quot;header-start sd-file-left&quot;&gt;&lt;button id=&quot;newCanvas&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M12 4v16M4 12h16&quot;\/&gt;&lt;\/svg&gt;\u65b0\u5efa\u8bbe\u8ba1&lt;\/button&gt;&lt;button id=&quot;importBtn&quot; class=&quot;file-import&quot; title=&quot;\u5bfc\u5165 PNG\u3001JPG \u6216 WebP \u56fe\u7247\uff1b\u9879\u76ee\u6587\u4ef6\u8bf7\u4f7f\u7528\u4e0b\u65b9\u8bb0\u5f55\u533a\u7684\u6253\u5f00\u672c\u673a\u9879\u76ee&quot; aria-label=&quot;\u5bfc\u5165\u6587\u4ef6&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M12 16V3m-5 5 5-5 5 5M4 15v5h16v-5&quot;\/&gt;&lt;\/svg&gt;&lt;span class=&quot;action-wide&quot;&gt;\u5bfc\u5165\u6587\u4ef6&lt;\/span&gt;&lt;span class=&quot;action-compact&quot; aria-hidden=&quot;true&quot;&gt;\u5bfc\u5165&lt;\/span&gt;&lt;\/button&gt;&lt;div class=&quot;header-history&quot;&gt;&lt;button id=&quot;undo&quot; title=&quot;\u64a4\u9500&quot; aria-label=&quot;\u64a4\u9500&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M4 10h10a6 6 0 0 1 0 12M8 5l-5 5 5 5&quot;\/&gt;&lt;\/svg&gt;&lt;span&gt;\u64a4\u9500&lt;\/span&gt;&lt;\/button&gt;&lt;button id=&quot;redo&quot; title=&quot;\u91cd\u505a&quot; aria-label=&quot;\u91cd\u505a&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M20 10H10a6 6 0 0 0 0 12m6-17 5 5-5 5&quot;\/&gt;&lt;\/svg&gt;&lt;span&gt;\u91cd\u505a&lt;\/span&gt;&lt;\/button&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;span id=&quot;projectStatus&quot; class=&quot;project-status sd-file-middle&quot; role=&quot;status&quot; aria-live=&quot;polite&quot;&gt;\u5c1a\u672a\u5f00\u59cb&lt;\/span&gt;&lt;div class=&quot;header-actions header-end sd-file-right&quot;&gt;&lt;div id=&quot;memberBanner&quot; class=&quot;member-account&quot;&gt;&lt;span id=&quot;memberLabel&quot; role=&quot;status&quot; aria-live=&quot;polite&quot;&gt;\u793a\u4f8b\u8bd5\u7528&lt;\/span&gt;&lt;button id=&quot;membershipAction&quot;&gt;\u767b\u5f55 \/ \u6ce8\u518c&lt;\/button&gt;&lt;\/div&gt;&lt;button id=&quot;saveProject&quot; class=&quot;desktop-save&quot; aria-label=&quot;\u4fdd\u5b58\u9879\u76ee&quot; title=&quot;\u4fdd\u5b58\u672c\u673a\u9879\u76ee\u6587\u4ef6&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M4 3h13l4 4v14H3V3Zm3 0v6h9V3M7 21v-8h10v8&quot;\/&gt;&lt;\/svg&gt;&lt;span class=&quot;action-wide&quot;&gt;\u4fdd\u5b58\u9879\u76ee&lt;\/span&gt;&lt;span class=&quot;action-compact&quot; aria-hidden=&quot;true&quot;&gt;\u4fdd\u5b58&lt;\/span&gt;&lt;\/button&gt;&lt;button id=&quot;focusWorkspace&quot; type=&quot;button&quot; aria-pressed=&quot;false&quot; aria-label=&quot;\u8fdb\u5165\u4e13\u6ce8\u6a21\u5f0f&quot; title=&quot;\u653e\u5927\u5de5\u4f5c\u53f0\uff0c\u4e13\u6ce8\u521b\u4f5c&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M8 3H3v5m13-5h5v5M3 16v5h5m13-5v5h-5&quot;\/&gt;&lt;\/svg&gt;&lt;span id=&quot;focusLabel&quot;&gt;\u4e13\u6ce8&lt;\/span&gt;&lt;\/button&gt;&lt;button id=&quot;exportOpen&quot; class=&quot;primary&quot; aria-label=&quot;\u5bfc\u51fa\u56fe\u7247&quot; title=&quot;\u5bfc\u51fa PNG\u3001JPG \u6216 WebP \u56fe\u7247&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M12 3v13m-5-5 5 5 5-5M4 16v5h16v-5&quot;\/&gt;&lt;\/svg&gt;&lt;span class=&quot;action-wide&quot;&gt;\u5bfc\u51fa\u56fe\u7247&lt;\/span&gt;&lt;span class=&quot;action-compact&quot; aria-hidden=&quot;true&quot;&gt;\u5bfc\u51fa&lt;\/span&gt;&lt;\/button&gt;&lt;\/div&gt;&lt;\/header&gt;\r\n&lt;div id=&quot;draftRecovery&quot; class=&quot;notice&quot; hidden&gt;&lt;p id=&quot;draftRecoveryText&quot; class=&quot;hint&quot;&gt;&lt;\/p&gt;&lt;div class=&quot;button-row&quot;&gt;&lt;button id=&quot;draftRestore&quot; type=&quot;button&quot;&gt;\u6062\u590d\u4e0a\u6b21\u8349\u7a3f&lt;\/button&gt;&lt;button id=&quot;draftKeep&quot; type=&quot;button&quot;&gt;\u4fdd\u7559\u65e7\u8349\u7a3f\uff0c\u6682\u4e0d\u81ea\u52a8\u4fdd\u5b58&lt;\/button&gt;&lt;button id=&quot;draftReplace&quot; type=&quot;button&quot;&gt;\u7528\u5f53\u524d\u4f5c\u54c1\u66ff\u6362\u8349\u7a3f&lt;\/button&gt;&lt;\/div&gt;&lt;\/div&gt;\r\n&lt;input id=&quot;fileInput&quot; type=&quot;file&quot; accept=&quot;image\/png,image\/jpeg,image\/webp&quot; multiple hidden&gt;&lt;input id=&quot;projectInput&quot; type=&quot;file&quot; accept=&quot;.json,application\/json&quot; hidden&gt;\r\n&lt;div class=&quot;workspace-auxiliary&quot; aria-label=&quot;\u7d20\u6750\u4e0e\u8f85\u52a9\u64cd\u4f5c&quot;&gt;&lt;button id=&quot;siteAssets&quot; title=&quot;\u641c\u7d22\u514d\u8d39\u3001\u5df2\u8d2d\u548c\u6536\u85cf\u7684\u672c\u7ad9\u7d20\u6750&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;3&quot; width=&quot;18&quot; height=&quot;18&quot; rx=&quot;3&quot;\/&gt;&lt;circle cx=&quot;9&quot; cy=&quot;9&quot; r=&quot;2&quot;\/&gt;&lt;path d=&quot;m3 17 6-5 4 3 4-5 4 7&quot;\/&gt;&lt;\/svg&gt;&lt;span&gt;\u672c\u7ad9\u7d20\u6750&lt;\/span&gt;&lt;span class=&quot;member-badge&quot; aria-label=&quot;\u5305\u542b\u514d\u8d39\u7d20\u6750&quot;&gt;\u514d\u8d39\u53ef\u7528&lt;\/span&gt;&lt;\/button&gt;&lt;\/div&gt;&lt;div id=&quot;siteFontNotice&quot; class=&quot;siw-font-notice&quot; hidden role=&quot;status&quot; aria-live=&quot;polite&quot;&gt;&lt;span id=&quot;siteFontNoticeText&quot;&gt;&lt;\/span&gt;&lt;button id=&quot;restoreSiteFonts&quot; type=&quot;button&quot; title=&quot;\u6309\u9879\u76ee\u4e2d\u7684\u5546\u54c1\u6388\u6743\u6062\u590d\u5b57\u4f53\uff0c\u5c06\u6cbf\u7528\u672c\u7ad9\u539f\u4e0b\u8f7d\u89c4\u5219&quot;&gt;\u6062\u590d\u9879\u76ee\u5b57\u4f53&lt;\/button&gt;&lt;span&gt;\u6062\u590d\u5b57\u4f53\u6cbf\u7528\u539f\u5546\u54c1\u7684\u6388\u6743\u4e0e\u4e0b\u8f7d\u89c4\u5219\u3002&lt;\/span&gt;&lt;\/div&gt;&lt;div id=&quot;notice&quot; class=&quot;notice&quot; role=&quot;status&quot; aria-live=&quot;polite&quot; hidden&gt;&lt;\/div&gt;\r\n&lt;section class=&quot;workspace&quot;&gt;&lt;nav id=&quot;toolRail&quot; class=&quot;tool-rail&quot; aria-label=&quot;\u4e3b\u8981\u5de5\u5177&quot;&gt;&lt;button type=&quot;button&quot; data-mode=&quot;edit&quot; aria-pressed=&quot;true&quot; class=&quot;mode-button active&quot;&gt;&lt;svg viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M4 3v14h17M3 7h14v14&quot;\/&gt;&lt;\/svg&gt;&lt;span&gt;\u57fa\u7840\u7f16\u8f91&lt;\/span&gt;&lt;\/button&gt;&lt;button type=&quot;button&quot; data-mode=&quot;templates&quot; aria-pressed=&quot;false&quot; class=&quot;mode-button&quot;&gt;&lt;svg viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;3&quot; width=&quot;18&quot; height=&quot;18&quot; rx=&quot;2&quot;\/&gt;&lt;path d=&quot;M3 9h18M9 9v12&quot;\/&gt;&lt;\/svg&gt;&lt;span&gt;\u6d77\u62a5\u6a21\u677f&lt;\/span&gt;&lt;\/button&gt;&lt;button type=&quot;button&quot; data-mode=&quot;selection&quot; aria-pressed=&quot;false&quot; class=&quot;mode-button&quot;&gt;&lt;svg viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M17 4c4 1 4 7 0 10-3 3-10 4-13 1-2-2-1-6 2-8 3-3 7-4 11-3Z&quot;\/&gt;&lt;path d=&quot;M6 17v4m-2-2h4&quot;\/&gt;&lt;\/svg&gt;&lt;span&gt;\u63d0\u53d6\u7d20\u6750&lt;\/span&gt;&lt;\/button&gt;&lt;button type=&quot;button&quot; data-mode=&quot;color&quot; aria-pressed=&quot;false&quot; class=&quot;mode-button&quot;&gt;&lt;svg viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;8&quot;\/&gt;&lt;path d=&quot;M12 4v16M4 12h16&quot;\/&gt;&lt;\/svg&gt;&lt;span&gt;\u8c03\u8272&lt;\/span&gt;&lt;\/button&gt;&lt;button type=&quot;button&quot; data-mode=&quot;text&quot; aria-pressed=&quot;false&quot; class=&quot;mode-button&quot;&gt;&lt;svg viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M4 6V4h16v2M12 4v16M8 20h8&quot;\/&gt;&lt;\/svg&gt;&lt;span&gt;\u6587\u5b57&lt;\/span&gt;&lt;\/button&gt;&lt;button type=&quot;button&quot; data-mode=&quot;shape&quot; aria-pressed=&quot;false&quot; class=&quot;mode-button&quot;&gt;&lt;svg viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;3&quot; width=&quot;11&quot; height=&quot;11&quot; rx=&quot;2&quot;\/&gt;&lt;circle cx=&quot;16&quot; cy=&quot;16&quot; r=&quot;5&quot;\/&gt;&lt;\/svg&gt;&lt;span&gt;\u5f62\u72b6&lt;\/span&gt;&lt;\/button&gt;&lt;button type=&quot;button&quot; data-mode=&quot;collage&quot; aria-pressed=&quot;false&quot; class=&quot;mode-button desktop-mode&quot;&gt;&lt;svg viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;4&quot; y=&quot;4&quot; width=&quot;16&quot; height=&quot;16&quot; rx=&quot;2&quot;\/&gt;&lt;path d=&quot;M12 4v16M4 12h16&quot;\/&gt;&lt;\/svg&gt;&lt;span&gt;\u62fc\u56fe&lt;\/span&gt;&lt;\/button&gt;&lt;button type=&quot;button&quot; data-mode=&quot;canvas&quot; aria-pressed=&quot;false&quot; class=&quot;mode-button&quot;&gt;&lt;svg viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;5&quot; width=&quot;18&quot; height=&quot;14&quot; rx=&quot;2&quot;\/&gt;&lt;path d=&quot;M8 10h8M8 14h5&quot;\/&gt;&lt;\/svg&gt;&lt;span&gt;\u753b\u5e03&lt;\/span&gt;&lt;\/button&gt;&lt;button type=&quot;button&quot; data-mode=&quot;more&quot; aria-pressed=&quot;false&quot; class=&quot;mode-button&quot;&gt;&lt;svg viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;5&quot; cy=&quot;12&quot; r=&quot;1&quot;\/&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;1&quot;\/&gt;&lt;circle cx=&quot;19&quot; cy=&quot;12&quot; r=&quot;1&quot;\/&gt;&lt;\/svg&gt;&lt;span&gt;\u6279\u91cf\u6587\u4ef6&lt;\/span&gt;&lt;\/button&gt;&lt;button type=&quot;button&quot; data-mode=&quot;assets&quot; aria-pressed=&quot;false&quot; class=&quot;mode-button&quot;&gt;&lt;svg viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;3&quot; width=&quot;18&quot; height=&quot;18&quot; rx=&quot;3&quot;\/&gt;&lt;circle cx=&quot;9&quot; cy=&quot;9&quot; r=&quot;2&quot;\/&gt;&lt;path d=&quot;m3 17 6-5 4 3 4-5 4 7&quot;\/&gt;&lt;\/svg&gt;&lt;span&gt;\u672c\u7ad9\u7d20\u6750&lt;\/span&gt;&lt;\/button&gt;&lt;\/nav&gt;&lt;aside id=&quot;propertiesDrawer&quot; class=&quot;inspector&quot; aria-labelledby=&quot;propertyTitle&quot;&gt;&lt;div class=&quot;property-heading&quot;&gt;&lt;h2 id=&quot;propertyTitle&quot;&gt;\u57fa\u7840\u7f16\u8f91&lt;\/h2&gt;&lt;button id=&quot;propertiesClose&quot; aria-label=&quot;\u5173\u95ed\u5de5\u5177\u5c5e\u6027&quot;&gt;\u00d7&lt;\/button&gt;&lt;\/div&gt;\r\n&lt;section id=&quot;selectionPanel&quot; hidden&gt;&lt;div id=&quot;selectionRefine&quot; class=&quot;selection-refine&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u9009\u533a\u65b9\u5f0f&lt;select id=&quot;selectionCombineMode&quot;&gt;&lt;option value=&quot;new&quot;&gt;\u65b0\u5efa\u9009\u533a&lt;\/option&gt;&lt;option value=&quot;add&quot;&gt;\u589e\u52a0\u5230\u9009\u533a&lt;\/option&gt;&lt;option value=&quot;subtract&quot;&gt;\u4ece\u9009\u533a\u51cf\u53bb&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u8fb9\u7f18\u7fbd\u5316\uff08px\uff09&lt;input id=&quot;selectionFeather&quot; type=&quot;number&quot; min=&quot;0&quot; max=&quot;24&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;check&quot;&gt;&lt;input id=&quot;autoSlice&quot; type=&quot;checkbox&quot; checked&gt;\u5708\u5b8c\u81ea\u52a8\u52a0\u5165\u6e05\u5355&lt;\/label&gt;&lt;button id=&quot;selectionUndoPart&quot; type=&quot;button&quot;&gt;\u64a4\u9500\u9009\u533a\u4e00\u6b65&lt;\/button&gt;&lt;button id=&quot;queueSelection&quot;&gt;\u52a0\u5165\u5207\u7247\u6e05\u5355&lt;\/button&gt;&lt;\/div&gt;&lt;details id=&quot;gridDetails&quot; class=&quot;property-group grid-details&quot;&gt;&lt;summary&gt;\u89c4\u5219\u5207\u7247&lt;\/summary&gt;&lt;p class=&quot;hint&quot;&gt;\u628a\u56fe\u7247\u6216\u6574\u5f20\u8bbe\u8ba1\u6309\u7f51\u683c\u7b49\u5206\u3002\u751f\u6210\u540e\u52a0\u5165\u4e0b\u65b9\u5207\u7247\u6e05\u5355\uff0c\u6e90\u56fe\u7247\u548c\u753b\u5e03\u4fdd\u6301\u4e0d\u53d8\u3002&lt;\/p&gt;&lt;label class=&quot;field&quot;&gt;\u5207\u7247\u6765\u6e90&lt;select id=&quot;splitSource&quot;&gt;&lt;option value=&quot;layer&quot;&gt;\u9009\u4e2d\u56fe\u7247 \u00b7 \u539f\u59cb\u50cf\u7d20&lt;\/option&gt;&lt;option value=&quot;canvas&quot;&gt;\u5f53\u524d\u753b\u5e03 \u00b7 \u53ef\u89c1\u56fe\u5c42\u4e0e\u80cc\u666f&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;p id=&quot;splitSourceInfo&quot; class=&quot;hint&quot;&gt;&lt;\/p&gt;&lt;label class=&quot;field&quot;&gt;\u6392\u5217\u65b9\u5f0f&lt;select id=&quot;splitPreset&quot;&gt;&lt;option value=&quot;3x3&quot;&gt;\u4e5d\u5bab\u683c \u00b7 3 \u00d7 3&lt;\/option&gt;&lt;option value=&quot;2x2&quot;&gt;\u56db\u5bab\u683c \u00b7 2 \u00d7 2&lt;\/option&gt;&lt;option value=&quot;1xn&quot;&gt;\u6a2a\u5411\u7b49\u5206 \u00b7 1 \u884c N \u5217&lt;\/option&gt;&lt;option value=&quot;nx1&quot;&gt;\u7eb5\u5411\u7b49\u5206 \u00b7 N \u884c 1 \u5217&lt;\/option&gt;&lt;option value=&quot;custom&quot;&gt;\u81ea\u5b9a\u4e49\u884c\u5217&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u884c\u6570&lt;input id=&quot;splitRows&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;12&quot; step=&quot;1&quot; value=&quot;3&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u5217\u6570&lt;input id=&quot;splitCols&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;12&quot; step=&quot;1&quot; value=&quot;3&quot;&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;canvas id=&quot;splitPreview&quot; class=&quot;grid-preview&quot; width=&quot;248&quot; height=&quot;180&quot; role=&quot;img&quot; aria-label=&quot;\u89c4\u5219\u5207\u7247\u7f16\u53f7\u9884\u89c8&quot;&gt;&lt;\/canvas&gt;&lt;p id=&quot;splitPreviewInfo&quot; class=&quot;hint&quot; role=&quot;status&quot; aria-live=&quot;polite&quot;&gt;&lt;\/p&gt;&lt;button id=&quot;splitExport&quot; type=&quot;button&quot; class=&quot;wide&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;3&quot; width=&quot;18&quot; height=&quot;18&quot; rx=&quot;2&quot;\/&gt;&lt;path d=&quot;M9 3v18M15 3v18M3 9h18M3 15h18&quot;\/&gt;&lt;\/svg&gt;\u751f\u6210\u5207\u7247\u5230\u6e05\u5355&lt;span class=&quot;member-badge&quot; aria-label=&quot;\u4f1a\u5458\u529f\u80fd&quot;&gt;\u4f1a\u5458&lt;\/span&gt;&lt;\/button&gt;&lt;p class=&quot;hint&quot;&gt;\u6bcf\u884c\u6216\u5217\u6700\u591a 12 \u4efd\uff0c\u6e05\u5355\u6700\u591a 30 \u7247\u3001\u5408\u8ba1 1600 \u4e07\u50cf\u7d20\u3002\u5947\u6570\u5c3a\u5bf8\u7684\u8fb9\u7f18\u50cf\u7d20\u4f1a\u5b8c\u6574\u5206\u914d\u3002&lt;\/p&gt;&lt;\/details&gt;&lt;div class=&quot;queue-heading&quot;&gt;&lt;span&gt;\u5df2\u63d0\u53d6 &lt;strong id=&quot;cutCount&quot;&gt;0&lt;\/strong&gt; \u7247&lt;\/span&gt;&lt;span class=&quot;format-badge&quot;&gt;PNG \u5207\u7247&lt;\/span&gt;&lt;\/div&gt;&lt;p class=&quot;hint queue-description&quot;&gt;\u5708\u9009\u6216\u89c4\u5219\u5207\u7247\u90fd\u4fdd\u5b58\u5728\u8fd9\u91cc\uff0c\u539f\u56fe\u548c\u753b\u5e03\u59cb\u7ec8\u4fdd\u7559\u3002&lt;\/p&gt;&lt;div id=&quot;selectionQueue&quot; class=&quot;selection-queue&quot;&gt;&lt;div class=&quot;queue-empty&quot;&gt;\u5708\u9009\u6216\u751f\u6210\u89c4\u5219\u5207\u7247\u540e\u4f1a\u663e\u793a\u5728\u8fd9\u91cc&lt;br&gt;\u53ef\u5355\u5f20\u4e0b\u8f7d\uff0c\u4e5f\u53ef\u5168\u90e8\u6253\u5305&lt;\/div&gt;&lt;\/div&gt;&lt;div class=&quot;queue-actions&quot;&gt;&lt;button id=&quot;queueExport&quot; class=&quot;primary wide&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M12 3v13m-5-5 5 5 5-5M4 16v5h16v-5&quot;\/&gt;&lt;\/svg&gt;\u6253\u5305\u4e0b\u8f7d ZIP&lt;span class=&quot;member-badge&quot; aria-label=&quot;\u4f1a\u5458\u529f\u80fd&quot;&gt;\u4f1a\u5458&lt;\/span&gt;&lt;\/button&gt;&lt;div class=&quot;button-row&quot;&gt;&lt;button id=&quot;queueUndo&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M4 10h10a6 6 0 0 1 0 12M8 5l-5 5 5 5&quot;\/&gt;&lt;\/svg&gt;\u64a4\u9500\u5207\u7247&lt;\/button&gt;&lt;button id=&quot;queueRedo&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M20 10H10a6 6 0 0 0 0 12m6-17 5 5-5 5&quot;\/&gt;&lt;\/svg&gt;\u6062\u590d\u5207\u7247&lt;\/button&gt;&lt;button id=&quot;queueClear&quot; class=&quot;danger&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M3 6h18M9 6V3h6v3M6 6l1 15h10l1-15M10 10v7m4-7v7&quot;\/&gt;&lt;\/svg&gt;\u6e05\u7a7a&lt;\/button&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;details class=&quot;export-details&quot;&gt;&lt;summary&gt;\u5bfc\u51fa\u8bf4\u660e&lt;\/summary&gt;&lt;p class=&quot;hint&quot;&gt;\u5355\u7247 PNG\uff1a\u514d\u8d39\u6700\u957f\u8fb9 2048\uff0c\u4f1a\u5458\u4fdd\u7559\u539f\u56fe\u50cf\u7d20\uff1b\u6279\u91cf ZIP \u9700\u4f1a\u5458\u3002\u6700\u591a 30 \u5757\uff0c\u5408\u8ba1 1600 \u4e07\u50cf\u7d20\u3002&lt;\/p&gt;&lt;\/details&gt;&lt;details id=&quot;vectorTools&quot; class=&quot;property-group vector-tools&quot;&gt;&lt;summary&gt;\u4f4d\u56fe\u8f6c SVG&lt;\/summary&gt;&lt;p class=&quot;hint&quot;&gt;\u628a\u6807\u5fd7\u3001\u7ebf\u7a3f\u548c\u7b80\u5355\u8272\u5757\u8f6c\u4e3a\u53ef\u7f29\u653e\u7684\u77e2\u91cf\u8def\u5f84\u3002&lt;\/p&gt;&lt;button id=&quot;vectorOpen&quot; class=&quot;wide&quot; type=&quot;button&quot;&gt;\u6253\u5f00\u77e2\u91cf\u63cf\u6479&lt;\/button&gt;&lt;\/details&gt;&lt;\/section&gt;\r\n&lt;div class=&quot;tabs&quot; hidden&gt;&lt;button data-tab=&quot;layer&quot;&gt;\u56fe\u5c42&lt;\/button&gt;&lt;button data-tab=&quot;image&quot;&gt;\u56fe\u7247&lt;\/button&gt;&lt;button data-tab=&quot;canvas&quot;&gt;\u753b\u5e03&lt;\/button&gt;&lt;\/div&gt;\r\n&lt;div id=&quot;tab-layer&quot; class=&quot;tab-content&quot; hidden&gt;&lt;section id=&quot;shapePalette&quot; class=&quot;property-group&quot; hidden&gt;&lt;h2&gt;\u6dfb\u52a0\u5f62\u72b6&lt;\/h2&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;button data-shape=&quot;rect&quot;&gt;\u25ad \u77e9\u5f62&lt;\/button&gt;&lt;button data-shape=&quot;roundrect&quot;&gt;\u25a2 \u5706\u89d2\u77e9\u5f62&lt;\/button&gt;&lt;button data-shape=&quot;ellipse&quot;&gt;\u25cb \u692d\u5706&lt;\/button&gt;&lt;button data-shape=&quot;triangle&quot;&gt;\u25b3 \u4e09\u89d2\u5f62&lt;\/button&gt;&lt;button data-shape=&quot;line&quot;&gt;\u2571 \u76f4\u7ebf&lt;\/button&gt;&lt;button data-shape=&quot;arrow&quot;&gt;\u2192 \u7bad\u5934&lt;\/button&gt;&lt;\/div&gt;&lt;p class=&quot;hint&quot;&gt;\u6dfb\u52a0\u540e\u53ef\u62d6\u52a8\u3001\u6539\u5c3a\u5bf8\u3001\u65cb\u8f6c\u548c\u8bbe\u7f6e\u989c\u8272\uff1b\u6bcf\u4e2a\u5f62\u72b6\u90fd\u662f\u72ec\u7acb\u56fe\u5c42\u3002&lt;\/p&gt;&lt;\/section&gt;&lt;div id=&quot;shapeControls&quot; hidden&gt;&lt;label class=&quot;field&quot;&gt;\u586b\u5145\u989c\u8272&lt;input id=&quot;shapeFill&quot; type=&quot;color&quot; value=&quot;#2468eb&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;check&quot;&gt;&lt;input id=&quot;shapeNoFill&quot; type=&quot;checkbox&quot;&gt;\u65e0\u586b\u5145\uff08\u4ec5\u63cf\u8fb9\uff09&lt;\/label&gt;&lt;\/div&gt;&lt;h2 id=&quot;selectedTitle&quot;&gt;\u5f53\u524d\u56fe\u5c42&lt;\/h2&gt;&lt;button id=&quot;addText&quot; class=&quot;wide&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M4 6V4h16v2M12 4v16M8 20h8&quot;\/&gt;&lt;\/svg&gt;\u6dfb\u52a0\u6587\u5b57 \/ \u6c34\u5370&lt;\/button&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;label class=&quot;field&quot;&gt;X&lt;input id=&quot;layerX&quot; type=&quot;number&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;Y&lt;input id=&quot;layerY&quot; type=&quot;number&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u6392\u7248\u5bbd&lt;input id=&quot;layerW&quot; type=&quot;number&quot; min=&quot;1&quot; value=&quot;100&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u6392\u7248\u9ad8&lt;input id=&quot;layerH&quot; type=&quot;number&quot; min=&quot;1&quot; value=&quot;100&quot;&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;label class=&quot;check&quot;&gt;&lt;input id=&quot;keepRatio&quot; type=&quot;checkbox&quot; checked&gt;\u8c03\u6574\u5c3a\u5bf8\u4fdd\u6301\u6bd4\u4f8b&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u65cb\u8f6c\u89d2\u5ea6&lt;input id=&quot;layerRotation&quot; type=&quot;number&quot; min=&quot;-360&quot; max=&quot;360&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u4e0d\u900f\u660e\u5ea6 &lt;output id=&quot;opacityValue&quot;&gt;100%&lt;\/output&gt;&lt;input id=&quot;layerOpacity&quot; type=&quot;range&quot; min=&quot;0&quot; max=&quot;100&quot; value=&quot;100&quot;&gt;&lt;\/label&gt;&lt;details id=&quot;designTextPresets&quot; class=&quot;property-group&quot;&gt;&lt;summary&gt;\u6587\u5b57\u6837\u5f0f\u4e0e\u7ec4\u5408&lt;\/summary&gt;&lt;p class=&quot;hint&quot;&gt;\u6837\u5f0f\u5e94\u7528\u4e8e\u9009\u4e2d\u6587\u5b57\uff1b\u7ec4\u5408\u4f1a\u65b0\u589e\u53ef\u72ec\u7acb\u7f16\u8f91\u7684\u6587\u5b57\u548c\u5f62\u72b6\u3002&lt;\/p&gt;&lt;div class=&quot;design-text-styles&quot;&gt;&lt;button type=&quot;button&quot; data-design-text-style=&quot;title&quot;&gt;\u9192\u76ee\u6807\u9898&lt;\/button&gt;&lt;button type=&quot;button&quot; data-design-text-style=&quot;body&quot;&gt;\u6e05\u6670\u6b63\u6587&lt;\/button&gt;&lt;button type=&quot;button&quot; data-design-text-style=&quot;label&quot;&gt;\u5f3a\u8c03\u6807\u7b7e&lt;\/button&gt;&lt;button type=&quot;button&quot; data-design-text-style=&quot;note&quot;&gt;\u8f85\u52a9\u8bf4\u660e&lt;\/button&gt;&lt;\/div&gt;&lt;div class=&quot;design-text-combos&quot;&gt;&lt;button type=&quot;button&quot; data-design-text-combo=&quot;heading&quot;&gt;&lt;strong&gt;\u4e3b\u6807\u9898&lt;\/strong&gt;&lt;small&gt;\u6807\u9898\uff0b\u526f\u6807\u9898&lt;\/small&gt;&lt;\/button&gt;&lt;button type=&quot;button&quot; data-design-text-combo=&quot;event&quot;&gt;&lt;strong&gt;\u6d3b\u52a8\u4fe1\u606f&lt;\/strong&gt;&lt;small&gt;\u65e5\u671f\uff0b\u65f6\u95f4\uff0b\u5730\u70b9&lt;\/small&gt;&lt;\/button&gt;&lt;button type=&quot;button&quot; data-design-text-combo=&quot;price&quot;&gt;&lt;strong&gt;\u00a5 29.9&lt;\/strong&gt;&lt;small&gt;\u4ef7\u683c\uff0b\u5546\u54c1\u8bf4\u660e&lt;\/small&gt;&lt;\/button&gt;&lt;button type=&quot;button&quot; data-design-text-combo=&quot;quote&quot;&gt;&lt;strong&gt;\u4e00\u53e5\u597d\u8bdd&lt;\/strong&gt;&lt;small&gt;\u5f15\u8a00\uff0b\u7f72\u540d&lt;\/small&gt;&lt;\/button&gt;&lt;\/div&gt;&lt;\/details&gt;\r\n&lt;div id=&quot;textControls&quot; hidden&gt;&lt;div class=&quot;divider&quot;&gt;&lt;\/div&gt;&lt;label class=&quot;field&quot;&gt;\u6587\u5b57 \/ \u6c34\u5370&lt;textarea id=&quot;textValue&quot; rows=&quot;3&quot;&gt;\u95ea\u5f97\u7d20\u6750&lt;\/textarea&gt;&lt;\/label&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u5b57\u53f7&lt;input id=&quot;textSize&quot; type=&quot;number&quot; min=&quot;8&quot; max=&quot;500&quot; value=&quot;48&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u989c\u8272&lt;input id=&quot;textColor&quot; type=&quot;color&quot; value=&quot;#182230&quot;&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;label class=&quot;field&quot;&gt;\u5b57\u4f53&lt;select id=&quot;textFont&quot;&gt;&lt;option value=&quot;sans-serif&quot;&gt;\u7cfb\u7edf\u65e0\u886c\u7ebf\uff08\u56de\u9000\uff09&lt;\/option&gt;&lt;option value=&quot;serif&quot;&gt;\u7cfb\u7edf\u886c\u7ebf\uff08\u56de\u9000\uff09&lt;\/option&gt;&lt;option value=&quot;monospace&quot;&gt;\u7cfb\u7edf\u7b49\u5bbd\uff08\u56de\u9000\uff09&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;details id=&quot;siteFontsDetails&quot; class=&quot;siw-site-fonts&quot;&gt;&lt;summary&gt;\u672c\u7ad9\u5b57\u4f53\u5e93&lt;\/summary&gt;&lt;p class=&quot;hint&quot;&gt;\u8fd9\u91cc\u4ec5\u5217\u51fa\u672c\u7ad9\u5b57\u4f53\u5e93\u4e2d\u7684\u5b57\u4f53\u3002\u514d\u8d39\u4e0e\u5df2\u8d2d\u5b57\u4f53\u65e0\u9700\u521b\u4f5c\u4f1a\u5458\uff0c\u5b57\u91cd\u548c\u6b3e\u5f0f\u4ece\u539f\u5b57\u4f53\u6587\u4ef6\u4e2d\u8bfb\u53d6\u3002&lt;\/p&gt;&lt;form id=&quot;fontSearchForm&quot; class=&quot;siw-library-search&quot;&gt;&lt;input id=&quot;fontQuery&quot; type=&quot;search&quot; maxlength=&quot;100&quot; placeholder=&quot;\u641c\u7d22\u672c\u7ad9\u5b57\u4f53&quot; aria-label=&quot;\u672c\u7ad9\u5b57\u4f53\u5173\u952e\u8bcd&quot;&gt;&lt;button type=&quot;submit&quot;&gt;\u641c\u7d22&lt;\/button&gt;&lt;\/form&gt;&lt;div class=&quot;siw-library-toolbar&quot;&gt;&lt;button id=&quot;fontClearLocation&quot; type=&quot;button&quot; hidden&gt;\u67e5\u770b\u5168\u90e8\u5b57\u4f53&lt;\/button&gt;&lt;span&gt;\u672c\u7ad9\u5ba1\u6838\u7684\u5b57\u4f53\u7d20\u6750&lt;\/span&gt;&lt;button id=&quot;fontRefresh&quot; type=&quot;button&quot;&gt;\u5237\u65b0\u6388\u6743&lt;\/button&gt;&lt;\/div&gt;&lt;p id=&quot;fontStatus&quot; class=&quot;hint&quot; role=&quot;status&quot; aria-live=&quot;polite&quot;&gt;\u5c55\u5f00\u540e\u8bfb\u53d6\u672c\u7ad9\u5b57\u4f53\u3002&lt;\/p&gt;&lt;div id=&quot;fontGrid&quot; class=&quot;siw-font-grid&quot;&gt;&lt;\/div&gt;&lt;div class=&quot;siw-library-pages&quot;&gt;&lt;button id=&quot;fontPrev&quot; disabled&gt;\u4e0a\u4e00\u9875&lt;\/button&gt;&lt;span id=&quot;fontPage&quot;&gt;1&lt;\/span&gt;&lt;button id=&quot;fontNext&quot; disabled&gt;\u4e0b\u4e00\u9875&lt;\/button&gt;&lt;\/div&gt;&lt;div id=&quot;fontCandidateBox&quot; hidden&gt;&lt;label class=&quot;field&quot;&gt;\u6b3e\u5f0f \/ \u5b57\u91cd&lt;select id=&quot;fontCandidates&quot;&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;div id=&quot;fontVariantGrid&quot; class=&quot;font-variant-grid&quot;&gt;&lt;\/div&gt;&lt;p class=&quot;hint&quot;&gt;\u70b9\u51fb\u9884\u89c8\u6b3e\u5f0f\uff0c\u7528\u5f53\u524d\u6587\u5b57\u67e5\u770b\u5b57\u6837\uff0c\u518d\u5e94\u7528\u5230\u4f5c\u54c1\u3002&lt;\/p&gt;&lt;button id=&quot;fontApply&quot; class=&quot;primary wide&quot;&gt;\u5e94\u7528\u6240\u9009\u5b57\u4f53&lt;\/button&gt;&lt;\/div&gt;&lt;\/details&gt;\r\n&lt;label class=&quot;check&quot;&gt;&lt;input id=&quot;textBold&quot; type=&quot;checkbox&quot;&gt;\u52a0\u7c97&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u5bf9\u9f50&lt;select id=&quot;textAlign&quot;&gt;&lt;option value=&quot;left&quot;&gt;\u5de6\u5bf9\u9f50&lt;\/option&gt;&lt;option value=&quot;center&quot;&gt;\u5c45\u4e2d&lt;\/option&gt;&lt;option value=&quot;right&quot;&gt;\u53f3\u5bf9\u9f50&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u884c\u8ddd\u500d\u6570&lt;input id=&quot;textLineHeight&quot; type=&quot;number&quot; min=&quot;0.8&quot; max=&quot;3&quot; step=&quot;0.1&quot; value=&quot;1.3&quot;&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;details class=&quot;style-details&quot;&gt;&lt;summary&gt;\u63cf\u8fb9\u4e0e\u9634\u5f71&lt;\/summary&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u63cf\u8fb9\u5bbd\u5ea6&lt;input id=&quot;strokeWidth&quot; type=&quot;number&quot; min=&quot;0&quot; max=&quot;40&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u63cf\u8fb9\u989c\u8272&lt;input id=&quot;strokeColor&quot; type=&quot;color&quot; value=&quot;#ffffff&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u9634\u5f71\u6a21\u7cca&lt;input id=&quot;shadowBlur&quot; type=&quot;number&quot; min=&quot;0&quot; max=&quot;100&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u9634\u5f71\u989c\u8272&lt;input id=&quot;shadowColor&quot; type=&quot;color&quot; value=&quot;#000000&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u9634\u5f71X&lt;input id=&quot;shadowX&quot; type=&quot;number&quot; min=&quot;-100&quot; max=&quot;100&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u9634\u5f71Y&lt;input id=&quot;shadowY&quot; type=&quot;number&quot; min=&quot;-100&quot; max=&quot;100&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;\/details&gt;&lt;button id=&quot;centerLayer&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M12 2v20M2 12h20&quot;\/&gt;&lt;rect x=&quot;6&quot; y=&quot;6&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;1&quot;\/&gt;&lt;\/svg&gt;\u56fe\u5c42\u5c45\u4e2d&lt;\/button&gt;&lt;\/div&gt;\r\n&lt;div id=&quot;tab-image&quot; class=&quot;tab-content&quot;&gt;&lt;section class=&quot;property-group&quot; data-image-part=&quot;base&quot;&gt;&lt;h2&gt;\u88c1\u526a\u4e0e\u65cb\u8f6c&lt;\/h2&gt;&lt;p class=&quot;hint&quot;&gt;\u5355\u5f20\u7167\u7247\u88c1\u526a\u540e\u540c\u6b65\u8c03\u6574\u753b\u5e03\uff1b\u6d77\u62a5\u4e2d\u7684\u56fe\u7247\u88c1\u526a\u4e0d\u6539\u53d8\u6d77\u62a5\u5c3a\u5bf8\u3002&lt;\/p&gt;&lt;label class=&quot;field&quot;&gt;\u88c1\u526a\u6bd4\u4f8b&lt;select id=&quot;cropRatio&quot;&gt;&lt;option value=&quot;free&quot;&gt;\u81ea\u7531\u6bd4\u4f8b&lt;\/option&gt;&lt;option value=&quot;1:1&quot;&gt;1 : 1 \u6b63\u65b9\u5f62&lt;\/option&gt;&lt;option value=&quot;4:3&quot;&gt;4 : 3 \u6a2a\u56fe&lt;\/option&gt;&lt;option value=&quot;3:4&quot;&gt;3 : 4 \u7ad6\u56fe&lt;\/option&gt;&lt;option value=&quot;16:9&quot;&gt;16 : 9 \u5bbd\u5c4f&lt;\/option&gt;&lt;option value=&quot;9:16&quot;&gt;9 : 16 \u624b\u673a&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;div class=&quot;button-row&quot;&gt;&lt;button data-tool=&quot;rect&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;4&quot; y=&quot;5&quot; width=&quot;16&quot; height=&quot;14&quot; rx=&quot;1&quot;\/&gt;&lt;\/svg&gt;\u753b\u51fa\u88c1\u526a\u533a\u57df&lt;\/button&gt;&lt;button id=&quot;applyCropInPanel&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m4 12 5 5L20 6&quot;\/&gt;&lt;\/svg&gt;\u5b8c\u6210\u88c1\u526a&lt;\/button&gt;&lt;button id=&quot;cancelCrop&quot; type=&quot;button&quot;&gt;\u53d6\u6d88&lt;\/button&gt;&lt;\/div&gt;&lt;div class=&quot;button-row&quot;&gt;&lt;button id=&quot;rotateLeft&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M4 10a8 8 0 1 1 0 5m0-5V4m0 6h6&quot;\/&gt;&lt;\/svg&gt;\u5de6\u8f6c90\u00b0&lt;\/button&gt;&lt;button id=&quot;rotateRight&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M20 10a8 8 0 1 0 0 5m0-5V4m0 6h-6&quot;\/&gt;&lt;\/svg&gt;\u53f3\u8f6c90\u00b0&lt;\/button&gt;&lt;button id=&quot;flipX&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M12 2v20M8 6 2 18h6Zm8 0 6 12h-6Z&quot;\/&gt;&lt;\/svg&gt;\u6c34\u5e73\u7ffb\u8f6c&lt;\/button&gt;&lt;button id=&quot;flipY&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M2 12h20M6 8 18 2v6ZM6 16l12 6v-6Z&quot;\/&gt;&lt;\/svg&gt;\u5782\u76f4\u7ffb\u8f6c&lt;\/button&gt;&lt;button id=&quot;trimTransparent&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M5 3v15h16M3 7h14v14&quot;\/&gt;&lt;\/svg&gt;\u88c1\u6389\u900f\u660e\u7559\u767d&lt;\/button&gt;&lt;button id=&quot;resetPixels&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M4 10a8 8 0 1 1 0 5m0-5V4m0 6h6M12 8v8m-4-4h8&quot;\/&gt;&lt;\/svg&gt;\u6062\u590d\u539f\u59cb\u56fe\u7247&lt;\/button&gt;&lt;\/div&gt;&lt;\/section&gt;&lt;section class=&quot;property-group&quot; data-image-part=&quot;base&quot;&gt;&lt;h2&gt;\u56fe\u7247\u50cf\u7d20\u5c3a\u5bf8&lt;\/h2&gt;&lt;p id=&quot;pixelSizeInfo&quot; class=&quot;hint&quot;&gt;\u9009\u4e2d\u56fe\u7247\u540e\u8c03\u6574\u5b9e\u9645\u50cf\u7d20\uff1b\u753b\u5e03\u6392\u7248\u5c3a\u5bf8\u5728\u56fe\u5c42\u8bbe\u7f6e\u4e2d\u8c03\u6574\u3002&lt;\/p&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u5bbd\u5ea6\uff08px\uff09&lt;input id=&quot;pixelW&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;8192&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u9ad8\u5ea6\uff08px\uff09&lt;input id=&quot;pixelH&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;8192&quot;&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;label class=&quot;check&quot;&gt;&lt;input id=&quot;pixelRatio&quot; type=&quot;checkbox&quot; checked&gt;\u9501\u5b9a\u539f\u56fe\u6bd4\u4f8b&lt;\/label&gt;&lt;button id=&quot;applyPixelResize&quot; class=&quot;wide&quot;&gt;\u5e94\u7528\u56fe\u7247\u5c3a\u5bf8&lt;\/button&gt;&lt;p class=&quot;hint&quot;&gt;\u652f\u6301\u64a4\u9500\u3002\u653e\u5927\u53ea\u589e\u52a0\u50cf\u7d20\u6570\u91cf\uff0c\u4e0d\u4f1a\u6062\u590d\u539f\u56fe\u6ca1\u6709\u7684\u7ec6\u8282\u3002&lt;\/p&gt;&lt;button id=&quot;singleExport&quot; class=&quot;wide&quot;&gt;\u5355\u5f20\u683c\u5f0f\u8f6c\u6362 \/ \u538b\u7f29&lt;\/button&gt;&lt;\/section&gt;&lt;section class=&quot;property-group&quot; data-image-part=&quot;color&quot;&gt;&lt;h2&gt;\u8c03\u8272&lt;\/h2&gt;&lt;p class=&quot;hint&quot;&gt;\u62d6\u52a8\u6ed1\u5757\u9884\u89c8\uff0c\u70b9\u51fb\u5e94\u7528\u540e\u751f\u6548\u3002\u53ef\u64a4\u9500\u3002&lt;\/p&gt;&lt;div class=&quot;retouch-compare&quot;&gt;&lt;figure&gt;&lt;div class=&quot;retouch-thumb&quot;&gt;&lt;canvas id=&quot;adjustBeforeThumb&quot; width=&quot;180&quot; height=&quot;128&quot; aria-label=&quot;\u8c03\u8272\u524d\u7f29\u7565\u56fe&quot;&gt;&lt;\/canvas&gt;&lt;\/div&gt;&lt;figcaption&gt;\u8c03\u8272\u524d&lt;\/figcaption&gt;&lt;\/figure&gt;&lt;figure&gt;&lt;div class=&quot;retouch-thumb&quot;&gt;&lt;canvas id=&quot;adjustAfterThumb&quot; width=&quot;180&quot; height=&quot;128&quot; aria-label=&quot;\u5f53\u524d\u8c03\u8272\u9884\u89c8&quot;&gt;&lt;\/canvas&gt;&lt;\/div&gt;&lt;figcaption&gt;\u5f53\u524d\u9884\u89c8&lt;\/figcaption&gt;&lt;\/figure&gt;&lt;\/div&gt;&lt;p id=&quot;adjustPreviewHint&quot; class=&quot;hint&quot;&gt;\u9009\u4e2d\u56fe\u7247\u540e\u663e\u793a\u8c03\u8272\u5bf9\u6bd4\u3002&lt;\/p&gt;&lt;div class=&quot;retouch-adjust-row&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u4eae\u5ea6&lt;output id=&quot;brightnessValue&quot;&gt;0&lt;\/output&gt;&lt;input id=&quot;brightness&quot; type=&quot;range&quot; min=&quot;-100&quot; max=&quot;100&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;button type=&quot;button&quot; class=&quot;retouch-reset&quot; data-adjust-reset=&quot;brightness&quot; aria-label=&quot;\u91cd\u7f6e\u4eae\u5ea6&quot;&gt;\u91cd\u7f6e&lt;\/button&gt;&lt;\/div&gt;&lt;div class=&quot;retouch-adjust-row&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u5bf9\u6bd4\u5ea6&lt;output id=&quot;contrastValue&quot;&gt;0&lt;\/output&gt;&lt;input id=&quot;contrast&quot; type=&quot;range&quot; min=&quot;-100&quot; max=&quot;100&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;button type=&quot;button&quot; class=&quot;retouch-reset&quot; data-adjust-reset=&quot;contrast&quot; aria-label=&quot;\u91cd\u7f6e\u5bf9\u6bd4\u5ea6&quot;&gt;\u91cd\u7f6e&lt;\/button&gt;&lt;\/div&gt;&lt;div class=&quot;retouch-adjust-row&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u9971\u548c\u5ea6&lt;output id=&quot;saturationValue&quot;&gt;0&lt;\/output&gt;&lt;input id=&quot;saturation&quot; type=&quot;range&quot; min=&quot;-100&quot; max=&quot;100&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;button type=&quot;button&quot; class=&quot;retouch-reset&quot; data-adjust-reset=&quot;saturation&quot; aria-label=&quot;\u91cd\u7f6e\u9971\u548c\u5ea6&quot;&gt;\u91cd\u7f6e&lt;\/button&gt;&lt;\/div&gt;&lt;div class=&quot;retouch-adjust-row&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u8272\u6e29&lt;output id=&quot;temperatureValue&quot;&gt;0&lt;\/output&gt;&lt;input id=&quot;temperature&quot; type=&quot;range&quot; min=&quot;-100&quot; max=&quot;100&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;button type=&quot;button&quot; class=&quot;retouch-reset&quot; data-adjust-reset=&quot;temperature&quot; aria-label=&quot;\u91cd\u7f6e\u8272\u6e29&quot;&gt;\u91cd\u7f6e&lt;\/button&gt;&lt;\/div&gt;&lt;div class=&quot;retouch-adjust-row&quot;&gt;&lt;label class=&quot;check&quot;&gt;&lt;input id=&quot;grayscale&quot; type=&quot;checkbox&quot;&gt;\u9ed1\u767d&lt;\/label&gt;&lt;button type=&quot;button&quot; class=&quot;retouch-reset&quot; data-adjust-reset=&quot;grayscale&quot; aria-label=&quot;\u91cd\u7f6e\u9ed1\u767d\u6548\u679c&quot;&gt;\u91cd\u7f6e&lt;\/button&gt;&lt;\/div&gt;&lt;div class=&quot;button-row&quot;&gt;&lt;button id=&quot;applyAdjust&quot; class=&quot;primary&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m4 12 5 5L20 6&quot;\/&gt;&lt;\/svg&gt;\u5e94\u7528\u8c03\u8272&lt;\/button&gt;&lt;button id=&quot;clearAdjust&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M4 10h10a6 6 0 0 1 0 12M8 5l-5 5 5 5&quot;\/&gt;&lt;\/svg&gt;\u91cd\u7f6e\u6ed1\u5757&lt;\/button&gt;&lt;\/div&gt;&lt;\/section&gt;&lt;section class=&quot;property-group&quot; data-image-part=&quot;brush&quot;&gt;&lt;h2&gt;\u624b\u52a8\u4fee\u56fe&lt;\/h2&gt;&lt;p class=&quot;hint&quot;&gt;\u5728\u5f53\u524d\u56fe\u7247\u56fe\u5c42\u4e0a\u6d82\u62b9\uff0c\u6bcf\u4e00\u7b14\u90fd\u53ef\u64a4\u9500\u3002\u67d4\u8fb9\u4e0e\u5f3a\u5ea6\u4e0d\u5f71\u54cd\u9a6c\u8d5b\u514b\u3002&lt;\/p&gt;&lt;div class=&quot;button-row&quot;&gt;&lt;button data-tool=&quot;paint&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m14 4 6 6M4 20l4-1L21 6l-3-3L5 16Z&quot;\/&gt;&lt;\/svg&gt;\u6d82\u9e26\u7b14&lt;\/button&gt;&lt;button data-tool=&quot;blur&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;7&quot;\/&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;3&quot;\/&gt;&lt;path d=&quot;M12 2v2m0 16v2M2 12h2m16 0h2&quot;\/&gt;&lt;\/svg&gt;\u5c40\u90e8\u6a21\u7cca&lt;\/button&gt;&lt;button data-tool=&quot;erase&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m5 17-3-3L13 3l9 9-9 9H9Zm4 4-4-4m1-8 9 9M9 21h13&quot;\/&gt;&lt;\/svg&gt;\u64e6\u9664&lt;\/button&gt;&lt;button data-tool=&quot;restore&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M4 10a8 8 0 1 1 0 5m0-5V4m0 6h6M12 8v8m-4-4h8&quot;\/&gt;&lt;\/svg&gt;\u6062\u590d&lt;\/button&gt;&lt;button data-tool=&quot;mosaic&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;3&quot; width=&quot;18&quot; height=&quot;18&quot; rx=&quot;2&quot;\/&gt;&lt;path d=&quot;M9 3v18M15 3v18M3 9h18M3 15h18&quot;\/&gt;&lt;\/svg&gt;\u9a6c\u8d5b\u514b&lt;\/button&gt;&lt;button data-tool=&quot;pick&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m15 3 6 6m-7-3 4 4L7 21H3v-4ZM16 4l2-2 4 4-2 2&quot;\/&gt;&lt;\/svg&gt;\u53d6\u8272\u7b14&lt;\/button&gt;&lt;\/div&gt;&lt;label class=&quot;field&quot; id=&quot;retouchSizeField&quot;&gt;\u753b\u7b14\u5927\u5c0f\uff08\u56fe\u7247\u50cf\u7d20\uff09&lt;input id=&quot;brushSize&quot; type=&quot;number&quot; min=&quot;2&quot; max=&quot;500&quot; value=&quot;40&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot; id=&quot;retouchMosaicField&quot;&gt;\u9a6c\u8d5b\u514b\u683c\u5b50\u5927\u5c0f&lt;input id=&quot;mosaicSize&quot; type=&quot;number&quot; min=&quot;2&quot; max=&quot;100&quot; value=&quot;16&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot; id=&quot;retouchColorField&quot; hidden&gt;\u753b\u7b14\u989c\u8272&lt;input id=&quot;brushColor&quot; type=&quot;color&quot; value=&quot;#2468eb&quot;&gt;&lt;\/label&gt;&lt;div id=&quot;retouchSoftSettings&quot; hidden&gt;&lt;label class=&quot;field&quot;&gt;\u67d4\u8fb9&lt;output id=&quot;brushSoftnessValue&quot;&gt;0%&lt;\/output&gt;&lt;input id=&quot;brushSoftness&quot; type=&quot;range&quot; min=&quot;0&quot; max=&quot;100&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u5f3a\u5ea6&lt;output id=&quot;brushStrengthValue&quot;&gt;100%&lt;\/output&gt;&lt;input id=&quot;brushStrength&quot; type=&quot;range&quot; min=&quot;1&quot; max=&quot;100&quot; value=&quot;100&quot;&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;label class=&quot;field&quot; id=&quot;retouchBlurField&quot; hidden&gt;\u6a21\u7cca\u534a\u5f84&lt;output id=&quot;blurRadiusValue&quot;&gt;8 px&lt;\/output&gt;&lt;input id=&quot;blurRadius&quot; type=&quot;range&quot; min=&quot;1&quot; max=&quot;24&quot; value=&quot;8&quot;&gt;&lt;\/label&gt;&lt;div id=&quot;pickedColor&quot; class=&quot;picked-color&quot; hidden&gt;&lt;\/div&gt;&lt;\/section&gt;&lt;\/div&gt;\r\n&lt;div id=&quot;tab-canvas&quot; class=&quot;tab-content&quot; hidden&gt;&lt;h2&gt;\u753b\u5e03\u5c3a\u5bf8&lt;\/h2&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u5bbd&lt;input id=&quot;canvasW&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;8192&quot; value=&quot;1200&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u9ad8&lt;input id=&quot;canvasH&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;8192&quot; value=&quot;1200&quot;&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;label class=&quot;check&quot;&gt;&lt;input id=&quot;scaleLayers&quot; type=&quot;checkbox&quot; checked&gt;\u540c\u6b65\u7f29\u653e\u56fe\u5c42&lt;\/label&gt;&lt;button id=&quot;applyCanvas&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m4 12 5 5L20 6&quot;\/&gt;&lt;\/svg&gt;\u5e94\u7528\u5c3a\u5bf8&lt;\/button&gt;&lt;div class=&quot;button-row presets&quot;&gt;&lt;button data-size=&quot;1600x900&quot;&gt;PPT 16:9&lt;\/button&gt;&lt;button data-size=&quot;1080x1440&quot;&gt;\u7b14\u8bb0\u5c01\u97623:4&lt;\/button&gt;&lt;button data-size=&quot;900x1200&quot;&gt;\u5546\u54c1\u4e3b\u56fe3:4&lt;\/button&gt;&lt;button data-size=&quot;1200x1200&quot;&gt;\u6b63\u65b9\u5f62&lt;\/button&gt;&lt;button data-size=&quot;1242x1656&quot;&gt;\u5c0f\u7ea2\u4e663:4&lt;\/button&gt;&lt;button data-size=&quot;1920x1080&quot;&gt;\u6a2a\u5c4f16:9&lt;\/button&gt;&lt;button data-size=&quot;1080x1920&quot;&gt;\u7ad6\u5c4f9:16&lt;\/button&gt;&lt;\/div&gt;&lt;div class=&quot;divider&quot;&gt;&lt;\/div&gt;&lt;h2&gt;\u80cc\u666f&lt;\/h2&gt;&lt;label class=&quot;check&quot;&gt;&lt;input id=&quot;transparentBg&quot; type=&quot;checkbox&quot; checked&gt;\u900f\u660e\u80cc\u666f&lt;\/label&gt;&lt;input id=&quot;canvasBg&quot; type=&quot;color&quot; value=&quot;#ffffff&quot; aria-label=&quot;\u753b\u5e03\u80cc\u666f\u989c\u8272&quot;&gt;&lt;p class=&quot;hint&quot;&gt;\u900f\u660e\u80cc\u666f\u5bfc\u51fa\u8bf7\u9009\u62e9PNG\u6216WebP\uff1bJPG\u4f1a\u586b\u767d\u8272\u80cc\u666f\u3002&lt;\/p&gt;&lt;div class=&quot;divider&quot;&gt;&lt;\/div&gt;&lt;h2&gt;\u64cd\u4f5c\u63d0\u793a&lt;\/h2&gt;&lt;p class=&quot;hint&quot;&gt;Ctrl \/ \u2318 + Z\uff1a\u64a4\u9500&lt;br&gt;Ctrl \/ \u2318 + Shift + Z\uff1a\u91cd\u505a&lt;br&gt;\u65b9\u5411\u952e\uff1a\u79fb\u52a8\u56fe\u5c42&lt;br&gt;Shift + \u65b9\u5411\u952e\uff1a\u79fb\u52a810\u50cf\u7d20&lt;br&gt;Delete\uff1a\u5220\u9664\u56fe\u5c42&lt;br&gt;Esc\uff1a\u53d6\u6d88\u9009\u533a&lt;\/p&gt;&lt;\/div&gt;\r\n&lt;section id=&quot;assetsPanel&quot; hidden aria-label=&quot;\u672c\u7ad9\u7d20\u6750\u5e93&quot;&gt;&lt;p class=&quot;hint&quot;&gt;\u4ece\u672c\u7ad9\u7d20\u6750\u5e93\u76f4\u63a5\u9009\u7528\u56fe\u7247\u3001\u514d\u62a0\u5143\u7d20\u4e0e\u56fe\u6807\u3002\u514d\u8d39\u7d20\u6750\u548c\u5df2\u8d2d\u7d20\u6750\u65e0\u9700\u989d\u5916\u5f00\u901a\u521b\u4f5c\u4f1a\u5458\uff1b\u4f7f\u7528\u4ecd\u6cbf\u7528\u5546\u54c1\u7684\u6388\u6743\u4e0e\u4e0b\u8f7d\u89c4\u5219\u3002&lt;\/p&gt;&lt;form id=&quot;assetSearchForm&quot; class=&quot;siw-library-search&quot;&gt;&lt;input id=&quot;assetQuery&quot; type=&quot;search&quot; maxlength=&quot;100&quot; placeholder=&quot;\u641c\u7d22\u56fe\u7247\u3001\u56fe\u6848\u3001\u88c5\u9970\u5143\u7d20&quot; aria-label=&quot;\u7d20\u6750\u5173\u952e\u8bcd&quot;&gt;&lt;button type=&quot;submit&quot;&gt;\u641c\u7d22&lt;\/button&gt;&lt;select id=&quot;assetCategory&quot; aria-label=&quot;\u7d20\u6750\u5206\u7c7b&quot;&gt;&lt;option value=&quot;&quot;&gt;\u5168\u90e8\u56fe\u7247\u5206\u7c7b&lt;\/option&gt;&lt;\/select&gt;&lt;select id=&quot;assetScope&quot; aria-label=&quot;\u7d20\u6750\u8303\u56f4&quot;&gt;&lt;option value=&quot;all&quot;&gt;\u5168\u90e8\u7d20\u6750&lt;\/option&gt;&lt;option value=&quot;free&quot;&gt;\u514d\u8d39\u7d20\u6750&lt;\/option&gt;&lt;option value=&quot;purchased&quot;&gt;\u5df2\u8d2d\u7d20\u6750&lt;\/option&gt;&lt;option value=&quot;favorites&quot;&gt;\u6211\u7684\u6536\u85cf&lt;\/option&gt;&lt;\/select&gt;&lt;\/form&gt;&lt;div class=&quot;siw-library-toolbar&quot;&gt;&lt;button id=&quot;assetClearLocation&quot; type=&quot;button&quot; hidden&gt;\u67e5\u770b\u5168\u90e8\u7d20\u6750&lt;\/button&gt;&lt;span&gt;\u5206\u7c7b\u4e0e\u7d20\u6750\u5e93\u540c\u6b65&lt;\/span&gt;&lt;button id=&quot;assetRefresh&quot; type=&quot;button&quot;&gt;\u5237\u65b0\u6388\u6743&lt;\/button&gt;&lt;\/div&gt;&lt;details id=&quot;recentAssetsDetails&quot;&gt;&lt;summary&gt;\u672c\u6b21\u4f7f\u7528\u7684\u7d20\u6750&lt;\/summary&gt;&lt;div id=&quot;recentAssetGrid&quot; class=&quot;siw-library-grid&quot;&gt;&lt;\/div&gt;&lt;\/details&gt;&lt;p id=&quot;assetStatus&quot; class=&quot;hint&quot; role=&quot;status&quot; aria-live=&quot;polite&quot;&gt;\u641c\u7d22\u672c\u7ad9\u7d20\u6750\uff0c\u5728\u8fd9\u91cc\u76f4\u63a5\u9009\u62e9\u539f\u56fe\u3002&lt;\/p&gt;&lt;div id=&quot;assetGrid&quot; class=&quot;siw-library-grid&quot;&gt;&lt;\/div&gt;&lt;div class=&quot;siw-library-pages&quot;&gt;&lt;button id=&quot;assetPrev&quot; disabled&gt;\u4e0a\u4e00\u9875&lt;\/button&gt;&lt;span id=&quot;assetPage&quot;&gt;1&lt;\/span&gt;&lt;button id=&quot;assetNext&quot; disabled&gt;\u4e0b\u4e00\u9875&lt;\/button&gt;&lt;\/div&gt;&lt;p class=&quot;hint siw-library-footnote&quot;&gt;PNG\u3001JPG\u3001WebP \u53ef\u76f4\u63a5\u63d2\u5165\uff0cZIP \u56fe\u7247\u5305\u53ef\u9009\u62e9\u5305\u5185\u539f\u56fe\u3002\u5176\u4ed6\u683c\u5f0f\u8bf7\u5230\u5546\u54c1\u9875\u67e5\u770b\u3002\u8d2d\u4e70\u540e\u8fd4\u56de\u672c\u9875\u5e76\u5237\u65b0\u6388\u6743\uff0c\u5f53\u524d\u4f5c\u54c1\u4f1a\u4fdd\u7559\u3002&lt;\/p&gt;&lt;\/section&gt;\r\n\r\n&lt;dialog id=&quot;imagePackageDialog&quot; aria-labelledby=&quot;imagePackageTitle&quot;&gt;&lt;div class=&quot;dialog-head&quot;&gt;&lt;h2 id=&quot;imagePackageTitle&quot;&gt;\u9009\u62e9\u5305\u5185\u56fe\u7247&lt;\/h2&gt;&lt;button id=&quot;imagePackageClose&quot; type=&quot;button&quot; class=&quot;icon-btn&quot; aria-label=&quot;\u5173\u95ed\u56fe\u7247\u5305&quot;&gt;\u00d7&lt;\/button&gt;&lt;\/div&gt;&lt;p class=&quot;hint&quot;&gt;\u52fe\u9009\u8981\u52a0\u5165\u4f5c\u54c1\u7684\u539f\u56fe\u3002\u672a\u9009\u62e9\u7684\u56fe\u7247\u4e0d\u4f1a\u52a0\u5165\u753b\u5e03\uff1b\u5f53\u524d\u4f5c\u54c1\u4fdd\u6301\u4e0d\u53d8\u3002&lt;\/p&gt;&lt;div id=&quot;imagePackageList&quot; class=&quot;siw-package-list&quot;&gt;&lt;\/div&gt;&lt;p id=&quot;imagePackageStatus&quot; role=&quot;status&quot; aria-live=&quot;polite&quot;&gt;&lt;\/p&gt;&lt;div class=&quot;dialog-actions&quot;&gt;&lt;button id=&quot;imagePackageCancel&quot; type=&quot;button&quot;&gt;\u53d6\u6d88&lt;\/button&gt;&lt;button id=&quot;imagePackageInsert&quot; type=&quot;button&quot; class=&quot;primary&quot; disabled&gt;\u63d2\u5165\u6240\u9009\u56fe\u7247&lt;\/button&gt;&lt;\/div&gt;&lt;\/dialog&gt;&lt;section id=&quot;templatePanel&quot; hidden&gt;&lt;h2&gt;\u539f\u521b\u6d77\u62a5\u6a21\u677f&lt;\/h2&gt;&lt;p class=&quot;hint&quot;&gt;\u4ece\u7a7a\u767d\u5f00\u59cb\uff0c\u6216\u7528\u53ef\u7f16\u8f91\u6a21\u677f\u5f00\u59cb\u3002\u6bcf\u6bb5\u6587\u5b57\u3001\u6bcf\u4e2a\u5f62\u72b6\u90fd\u53ef\u4ee5\u5355\u72ec\u8c03\u6574\u3002&lt;\/p&gt;&lt;button id=&quot;designBlank&quot; type=&quot;button&quot; class=&quot;wide&quot;&gt;\uff0b \u4ece\u7a7a\u767d\u753b\u5e03\u5f00\u59cb&lt;\/button&gt;&lt;label class=&quot;field&quot;&gt;\u67e5\u627e\u6a21\u677f&lt;input id=&quot;designTemplateSearch&quot; type=&quot;search&quot; placeholder=&quot;\u641c\u7d22\u6559\u80b2\u3001\u6d3b\u52a8\u3001\u5546\u54c1\u2026&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u4e3b\u9898&lt;select id=&quot;designTemplateCategory&quot;&gt;&lt;option value=&quot;all&quot;&gt;\u5168\u90e8\u4e3b\u9898&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;div id=&quot;designTemplateCards&quot; class=&quot;design-template-grid&quot;&gt;&lt;\/div&gt;&lt;p id=&quot;designTemplateStatus&quot; class=&quot;hint&quot; role=&quot;status&quot;&gt;&lt;\/p&gt;&lt;\/section&gt;\r\n&lt;section id=&quot;collagePanel&quot; hidden&gt;&lt;h2&gt;\u62fc\u56fe\u6392\u7248&lt;\/h2&gt;&lt;p class=&quot;hint&quot;&gt;\u9009\u62e9\u7248\u5f0f\uff0c\u5c06\u53ef\u89c1\u4e14\u672a\u9501\u5b9a\u7684\u56fe\u7247\u6392\u5165\u683c\u5b50\u3002\u56fe\u7247\u539f\u6587\u4ef6\u59cb\u7ec8\u4fdd\u7559\uff0c\u6bcf\u4e00\u683c\u90fd\u80fd\u7ee7\u7eed\u7f16\u8f91\u3002&lt;\/p&gt;&lt;div id=&quot;collageLayouts&quot; class=&quot;design-layout-grid&quot; aria-label=&quot;\u62fc\u56fe\u7248\u5f0f&quot;&gt;&lt;\/div&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u753b\u5e03\u5bbd\u5ea6&lt;input id=&quot;collageWidth&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;8192&quot; value=&quot;1200&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u753b\u5e03\u9ad8\u5ea6&lt;input id=&quot;collageHeight&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;8192&quot; value=&quot;1200&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u7f51\u683c\u5217\u6570&lt;input id=&quot;collageCols&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;8&quot; value=&quot;2&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u56fe\u7247\u95f4\u8ddd&lt;input id=&quot;collageGap&quot; type=&quot;number&quot; min=&quot;0&quot; max=&quot;200&quot; value=&quot;20&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u56db\u5468\u7559\u767d&lt;input id=&quot;collagePadding&quot; type=&quot;number&quot; min=&quot;0&quot; max=&quot;300&quot; value=&quot;40&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u683c\u5b50\u5706\u89d2&lt;input id=&quot;collageRadius&quot; type=&quot;number&quot; min=&quot;0&quot; max=&quot;200&quot; value=&quot;18&quot;&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;label class=&quot;field&quot;&gt;\u4e3b\u56fe\uff08\u4e3b\u56fe\u7248\u5f0f\u751f\u6548\uff09&lt;select id=&quot;collageMainImage&quot;&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u80cc\u666f&lt;input id=&quot;collageBg&quot; type=&quot;color&quot; value=&quot;#ffffff&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;check&quot;&gt;&lt;input id=&quot;collageTransparent&quot; type=&quot;checkbox&quot;&gt;\u900f\u660e\u80cc\u666f&lt;\/label&gt;&lt;\/div&gt;&lt;button id=&quot;collage&quot; class=&quot;primary wide&quot;&gt;\u5e94\u7528\u62fc\u56fe\u7248\u5f0f&lt;\/button&gt;&lt;p id=&quot;collageLayoutInfo&quot; class=&quot;hint&quot; role=&quot;status&quot;&gt;&lt;\/p&gt;&lt;details id=&quot;collageCellDetails&quot; class=&quot;property-group&quot; open&gt;&lt;summary&gt;\u8c03\u6574\u683c\u5185\u56fe\u7247&lt;\/summary&gt;&lt;label class=&quot;field&quot;&gt;\u9009\u62e9\u683c\u5b50&lt;select id=&quot;collageCellSelect&quot;&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u56fe\u7247\u663e\u793a&lt;select id=&quot;collageFit&quot;&gt;&lt;option value=&quot;cover&quot;&gt;\u94fa\u6ee1\u683c\u5b50 \u00b7 \u88c1\u53bb\u8d85\u51fa\u90e8\u5206&lt;\/option&gt;&lt;option value=&quot;contain&quot;&gt;\u5b8c\u6574\u663e\u793a \u00b7 \u4fdd\u7559\u7559\u767d&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u5de6\u53f3\u4f4d\u7f6e&lt;input id=&quot;collageOffsetX&quot; type=&quot;range&quot; min=&quot;0&quot; max=&quot;100&quot; step=&quot;1&quot; value=&quot;50&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u4e0a\u4e0b\u4f4d\u7f6e&lt;input id=&quot;collageOffsetY&quot; type=&quot;range&quot; min=&quot;0&quot; max=&quot;100&quot; step=&quot;1&quot; value=&quot;50&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u683c\u5185\u653e\u5927&lt;input id=&quot;collageZoom&quot; type=&quot;range&quot; min=&quot;100&quot; max=&quot;300&quot; step=&quot;5&quot; value=&quot;100&quot;&gt;&lt;\/label&gt;&lt;div class=&quot;button-row&quot;&gt;&lt;button id=&quot;collageCellReset&quot; type=&quot;button&quot;&gt;\u5c45\u4e2d\u8fd8\u539f&lt;\/button&gt;&lt;button id=&quot;collageDetach&quot; type=&quot;button&quot;&gt;\u89e3\u9664\u683c\u5b50\u88c1\u5207&lt;\/button&gt;&lt;\/div&gt;&lt;label class=&quot;field&quot;&gt;\u66ff\u6362\u4e3a\u5df2\u5bfc\u5165\u56fe\u7247&lt;select id=&quot;collageReplacement&quot;&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;div class=&quot;button-row&quot;&gt;&lt;button id=&quot;collageReplace&quot; type=&quot;button&quot;&gt;\u66ff\u6362\u6b64\u683c\u56fe\u7247&lt;\/button&gt;&lt;button id=&quot;collageImport&quot; type=&quot;button&quot;&gt;\u6dfb\u52a0\u5176\u4ed6\u56fe\u7247&lt;\/button&gt;&lt;\/div&gt;&lt;p class=&quot;hint&quot;&gt;\u5148\u6dfb\u52a0\u56fe\u7247\uff0c\u518d\u4ece\u5217\u8868\u9009\u62e9\u66ff\u6362\u3002\u66ff\u6362\u53ea\u6539\u53d8\u5f53\u524d\u683c\u5b50\u7684\u56fe\u7247\u5185\u5bb9\uff0c\u4e0d\u6539\u53d8\u5176\u4ed6\u56fe\u5c42\u3002&lt;\/p&gt;&lt;\/details&gt;&lt;\/section&gt;\r\n\r\n&lt;section id=&quot;morePanel&quot; hidden&gt;&lt;h2&gt;\u6279\u91cf\u5904\u7406\u4e0e\u9879\u76ee\u6587\u4ef6&lt;\/h2&gt;&lt;label class=&quot;field&quot;&gt;\u9879\u76ee\u540d\u79f0&lt;input id=&quot;projectName&quot; type=&quot;text&quot; maxlength=&quot;80&quot; value=&quot;\u672a\u547d\u540d\u8bbe\u8ba1&quot; autocomplete=&quot;off&quot;&gt;&lt;\/label&gt;&lt;p id=&quot;autoDraftStatus&quot; class=&quot;hint&quot; role=&quot;status&quot; aria-live=&quot;polite&quot;&gt;\u767b\u5f55\u540e\u81ea\u52a8\u4fdd\u5b58\u5230\u5f53\u524d\u6d4f\u89c8\u5668\uff1b\u91cd\u8981\u4f5c\u54c1\u8bf7\u53e6\u5b58\u9879\u76ee\u6587\u4ef6\u3002&lt;\/p&gt;&lt;div class=&quot;more-actions&quot;&gt;&lt;button id=&quot;saveDraft&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M4 3h13l4 4v14H3V3Zm3 0v6h9V3M7 21v-8h10v8&quot;\/&gt;&lt;\/svg&gt;\u5b58\u4e3a\u672c\u673a\u8349\u7a3f&lt;\/button&gt;&lt;button id=&quot;openDraft&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M3 6h7l2 3h9v12H3Z&quot;\/&gt;&lt;\/svg&gt;\u6062\u590d\u4e0a\u6b21\u8349\u7a3f&lt;\/button&gt;&lt;button id=&quot;saveProjectMobile&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M4 3h13l4 4v14H3V3Zm3 0v6h9V3M7 21v-8h10v8&quot;\/&gt;&lt;\/svg&gt;\u4fdd\u5b58\u672c\u673a\u9879\u76ee&lt;\/button&gt;&lt;button id=&quot;loadProject&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 2H4v20h16V8Zm0 0v6h6M8 12h8M8 16h8&quot;\/&gt;&lt;\/svg&gt;\u6253\u5f00\u672c\u673a\u9879\u76ee&lt;\/button&gt;&lt;button id=&quot;batchOpen&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m12 3 10 5-10 5L2 8Zm-9 10 9 5 9-5M3 18l9 5 9-5&quot;\/&gt;&lt;\/svg&gt;\u6279\u91cf\u5c3a\u5bf8 \/ \u683c\u5f0f \/ \u538b\u7f29&lt;span class=&quot;member-badge&quot; aria-label=&quot;\u4f1a\u5458\u529f\u80fd&quot;&gt;\u4f1a\u5458&lt;\/span&gt;&lt;\/button&gt;&lt;\/div&gt;&lt;p class=&quot;hint&quot;&gt;\u6279\u91cf\u5de5\u5177\u5904\u7406\u6bcf\u5f20\u5bfc\u5165\u56fe\u7247\u3002\u5708\u9009\u7ed3\u679c\u8bf7\u4f7f\u7528\u201c\u4e0b\u8f7d\u5168\u90e8\u5708\u9009\u5207\u7247ZIP\u201d\u3002&lt;\/p&gt;&lt;\/section&gt;\r\n&lt;details id=&quot;layersDetails&quot; class=&quot;layers-details&quot;&gt;&lt;summary&gt;\u56fe\u5c42\u4e0e\u539f\u56fe &lt;span id=&quot;layerCount&quot;&gt;0&lt;\/span&gt;&lt;\/summary&gt;&lt;div id=&quot;layers&quot; class=&quot;layer-list&quot; role=&quot;listbox&quot; aria-multiselectable=&quot;true&quot;&gt;&lt;div class=&quot;empty-list&quot;&gt;\u8fd8\u6ca1\u6709\u56fe\u7247&lt;\/div&gt;&lt;\/div&gt;&lt;div id=&quot;canvasSelectionTools&quot; class=&quot;canvas-selection-tools&quot;&gt;\r\n&lt;p id=&quot;canvasSelectionStatus&quot; class=&quot;hint&quot; role=&quot;status&quot;&gt;\u70b9\u51fb\u5bf9\u8c61\uff0c\u6216\u4ece\u7a7a\u767d\u5904\u62d6\u51fa\u9009\u6846&lt;\/p&gt;\r\n&lt;div class=&quot;button-row&quot;&gt;&lt;button id=&quot;groupSelection&quot; type=&quot;button&quot;&gt;\u7ec4\u5408&lt;\/button&gt;&lt;button id=&quot;ungroupSelection&quot; type=&quot;button&quot;&gt;\u53d6\u6d88\u7ec4\u5408&lt;\/button&gt;&lt;button id=&quot;lockSelection&quot; type=&quot;button&quot;&gt;\u9501\u5b9a&lt;\/button&gt;&lt;\/div&gt;\r\n&lt;details class=&quot;canvas-align-tools&quot;&gt;&lt;summary&gt;\u5bf9\u9f50\u4e0e\u5206\u5e03&lt;\/summary&gt;&lt;p class=&quot;hint&quot;&gt;\u5355\u4e2a\u5bf9\u8c61\u76f8\u5bf9\u753b\u5e03\uff1b\u591a\u4e2a\u5bf9\u8c61\u76f8\u5bf9\u9009\u62e9\u8303\u56f4\u3002\u7ec4\u5408\u89c6\u4e3a\u4e00\u4e2a\u5bf9\u8c61\u3002&lt;\/p&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;button data-canvas-align=&quot;left&quot;&gt;\u5de6\u5bf9\u9f50&lt;\/button&gt;&lt;button data-canvas-align=&quot;right&quot;&gt;\u53f3\u5bf9\u9f50&lt;\/button&gt;&lt;button data-canvas-align=&quot;centerX&quot;&gt;\u6c34\u5e73\u5c45\u4e2d&lt;\/button&gt;&lt;button data-canvas-align=&quot;centerY&quot;&gt;\u5782\u76f4\u5c45\u4e2d&lt;\/button&gt;&lt;button data-canvas-align=&quot;top&quot;&gt;\u9876\u5bf9\u9f50&lt;\/button&gt;&lt;button data-canvas-align=&quot;bottom&quot;&gt;\u5e95\u5bf9\u9f50&lt;\/button&gt;&lt;button data-canvas-align=&quot;distributeX&quot;&gt;\u6c34\u5e73\u7b49\u8ddd&lt;\/button&gt;&lt;button data-canvas-align=&quot;distributeY&quot;&gt;\u5782\u76f4\u7b49\u8ddd&lt;\/button&gt;&lt;\/div&gt;&lt;\/details&gt;\r\n&lt;label class=&quot;check&quot;&gt;&lt;input id=&quot;canvasSnap&quot; type=&quot;checkbox&quot; checked&gt;\u79fb\u52a8\u65f6\u5438\u9644\u753b\u5e03\u4e0e\u5176\u4ed6\u5bf9\u8c61\uff08Alt \u6682\u505c\uff09&lt;\/label&gt;\r\n&lt;p class=&quot;hint&quot;&gt;Shift \u70b9\u51fb\u591a\u9009\uff0c\u7a7a\u767d\u5904\u62d6\u52a8\u6846\u9009\uff1b\u62d6\u52a8\u89d2\u70b9\u7f29\u653e\u3001\u5706\u70b9\u65cb\u8f6c\u3002Shift \u65cb\u8f6c\u6309 15\u00b0 \u5438\u9644\u3002\u53cc\u51fb\u6587\u5b57\u76f4\u63a5\u7f16\u8f91\u3002&lt;\/p&gt;\r\n&lt;\/div&gt;\r\n&lt;div class=&quot;button-row layer-buttons&quot;&gt;&lt;button id=&quot;layerTop&quot; type=&quot;button&quot;&gt;\u7f6e\u9876&lt;\/button&gt;&lt;button id=&quot;layerBottom&quot; type=&quot;button&quot;&gt;\u7f6e\u5e95&lt;\/button&gt;&lt;button id=&quot;layerUp&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M12 21V3m-7 7 7-7 7 7&quot;\/&gt;&lt;\/svg&gt;\u4e0a\u79fb&lt;\/button&gt;&lt;button id=&quot;layerDown&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M12 3v18m-7-7 7 7 7-7&quot;\/&gt;&lt;\/svg&gt;\u4e0b\u79fb&lt;\/button&gt;&lt;button id=&quot;duplicate&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;8&quot; y=&quot;8&quot; width=&quot;13&quot; height=&quot;13&quot; rx=&quot;2&quot;\/&gt;&lt;path d=&quot;M16 8V3H3v13h5&quot;\/&gt;&lt;\/svg&gt;\u590d\u5236&lt;\/button&gt;&lt;button id=&quot;deleteLayer&quot; class=&quot;danger&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M3 6h18M9 6V3h6v3M6 6l1 15h10l1-15M10 10v7m4-7v7&quot;\/&gt;&lt;\/svg&gt;\u5220\u9664&lt;\/button&gt;&lt;\/div&gt;&lt;button id=&quot;moveTool&quot; data-tool=&quot;move&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M12 2v20M2 12h20M9 5l3-3 3 3M9 19l3 3 3-3M5 9l-3 3 3 3m14-6 3 3-3 3&quot;\/&gt;&lt;\/svg&gt;\u79fb\u52a8\u56fe\u5c42&lt;\/button&gt;&lt;\/details&gt;\r\n&lt;\/aside&gt;\r\n&lt;section class=&quot;stage-panel&quot;&gt;&lt;div class=&quot;stage-top&quot;&gt;&lt;div&gt;&lt;h2 id=&quot;modeTitle&quot;&gt;\u57fa\u7840\u7f16\u8f91&lt;\/h2&gt;&lt;p id=&quot;toolHint&quot; class=&quot;hint&quot;&gt;\u6cbf\u5143\u7d20\u8f6e\u5ed3\u5708\u9009\uff0c\u677e\u5f00\u540e\u81ea\u52a8\u751f\u6210\u900f\u660ePNG\uff0c\u5e76\u52a0\u5165\u5207\u7247\u6e05\u5355\u3002\u7ee7\u7eed\u5708\u4e0b\u4e00\u5904\u5373\u53ef\u3002&lt;\/p&gt;&lt;\/div&gt;&lt;span id=&quot;canvasInfo&quot;&gt;1200 \u00d7 1200&lt;\/span&gt;&lt;\/div&gt;\r\n&lt;div class=&quot;selection-tools&quot;&gt;&lt;div class=&quot;segmented&quot; role=&quot;toolbar&quot; aria-label=&quot;\u5708\u9009\u65b9\u5f0f&quot;&gt;&lt;button data-tool=&quot;lasso&quot; class=&quot;active&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M17 4c4 1 4 7 0 10-3 3-10 4-13 1-2-2-1-6 2-8 3-3 7-4 11-3Z&quot;\/&gt;&lt;path d=&quot;M6 17v4m-2-2h4&quot;\/&gt;&lt;\/svg&gt;\u5957\u7d22&lt;\/button&gt;&lt;button data-tool=&quot;ellipse&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;ellipse cx=&quot;12&quot; cy=&quot;12&quot; rx=&quot;9&quot; ry=&quot;7&quot;\/&gt;&lt;\/svg&gt;\u692d\u5706&lt;\/button&gt;&lt;button data-tool=&quot;rect&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;4&quot; y=&quot;5&quot; width=&quot;16&quot; height=&quot;14&quot; rx=&quot;1&quot;\/&gt;&lt;\/svg&gt;\u77e9\u5f62&lt;\/button&gt;&lt;\/div&gt;&lt;label class=&quot;padding-control&quot;&gt;\u7559\u8fb9&lt;input id=&quot;selectionPadding&quot; type=&quot;number&quot; min=&quot;0&quot; max=&quot;32&quot; value=&quot;2&quot;&gt;&lt;span&gt;px&lt;\/span&gt;&lt;\/label&gt;&lt;\/div&gt;\r\n\r\n&lt;div id=&quot;stageWrap&quot; class=&quot;stage-wrap&quot;&gt;&lt;canvas id=&quot;stage&quot; width=&quot;1200&quot; height=&quot;1200&quot; aria-label=&quot;\u56fe\u7247\u7f16\u8f91\u753b\u5e03&quot;&gt;&lt;\/canvas&gt;&lt;div id=&quot;emptyStage&quot; class=&quot;empty-stage&quot;&gt;&lt;span class=&quot;empty-icon&quot;&gt;&lt;svg viewBox=&quot;0 0 64 64&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;10&quot; y=&quot;13&quot; width=&quot;40&quot; height=&quot;40&quot; rx=&quot;8&quot;\/&gt;&lt;path d=&quot;m13 43 12-13 10 9 7-8 8 10&quot;\/&gt;&lt;circle cx=&quot;39&quot; cy=&quot;25&quot; r=&quot;4&quot;\/&gt;&lt;path d=&quot;M50 5v16m-8-8h16&quot;\/&gt;&lt;\/svg&gt;&lt;\/span&gt;&lt;h2&gt;\u4fee\u4e00\u5f20\u56fe\uff0c\u6216\u8bbe\u8ba1\u4e00\u5f20\u6d77\u62a5&lt;\/h2&gt;&lt;p&gt;\u4ece\u7167\u7247\u5f00\u59cb\u7f16\u8f91\uff0c\u6216\u7528\u7a7a\u767d\u753b\u5e03\u81ea\u7531\u8bbe\u8ba1&lt;\/p&gt;&lt;div class=&quot;start-options&quot;&gt;&lt;button id=&quot;emptyImport&quot; type=&quot;button&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;3&quot; width=&quot;18&quot; height=&quot;18&quot; rx=&quot;3&quot;\/&gt;&lt;circle cx=&quot;8&quot; cy=&quot;8&quot; r=&quot;2&quot;\/&gt;&lt;path d=&quot;m3 17 6-6 4 4 4-5 4 7&quot;\/&gt;&lt;\/svg&gt;&lt;strong&gt;\u6253\u5f00\u56fe\u7247&lt;\/strong&gt;&lt;span&gt;\u88c1\u526a\u3001\u8c03\u8272\u4e0e\u4fee\u9970&lt;\/span&gt;&lt;\/button&gt;&lt;button id=&quot;emptyNew&quot; type=&quot;button&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;4&quot; y=&quot;2&quot; width=&quot;16&quot; height=&quot;20&quot; rx=&quot;2&quot;\/&gt;&lt;path d=&quot;M8 8h8M8 12h5M8 17h8&quot;\/&gt;&lt;\/svg&gt;&lt;strong&gt;\u65b0\u5efa\u8bbe\u8ba1&lt;\/strong&gt;&lt;span&gt;\u6d77\u62a5\u3001\u5c01\u9762\u4e0e\u81ea\u7531\u6392\u7248&lt;\/span&gt;&lt;\/button&gt;&lt;\/div&gt;&lt;button id=&quot;tryDemo&quot; class=&quot;quiet&quot;&gt;\u7528\u793a\u4f8b\u4f53\u9a8c\u5de5\u4f5c\u53f0 \u2192&lt;\/button&gt;&lt;small&gt;\u652f\u6301 PNG\u3001JPG\u3001WebP \u00b7 \u4e5f\u53ef\u62d6\u5165\u56fe\u7247&lt;\/small&gt;&lt;\/div&gt;&lt;\/div&gt;\r\n&lt;div class=&quot;selection-actions&quot;&gt;&lt;span id=&quot;selectionInfo&quot;&gt;\u62d6\u52a8\u5708\u9009\uff0c\u677e\u5f00\u751f\u6210\u5207\u7247&lt;\/span&gt;&lt;div class=&quot;button-row&quot;&gt;&lt;button id=&quot;downloadSelection&quot; class=&quot;primary&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M10 9 20 3M10 15l10 6M20 12H4&quot;\/&gt;&lt;circle cx=&quot;6&quot; cy=&quot;6&quot; r=&quot;3&quot;\/&gt;&lt;circle cx=&quot;6&quot; cy=&quot;18&quot; r=&quot;3&quot;\/&gt;&lt;\/svg&gt;\u4e0b\u8f7d\u9009\u533a PNG&lt;\/button&gt;&lt;button id=&quot;clearSelection&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m6 6 12 12M6 18 18 6&quot;\/&gt;&lt;\/svg&gt;\u53d6\u6d88\u9009\u533a&lt;\/button&gt;&lt;button id=&quot;mobilePropertiesToggle&quot; aria-controls=&quot;propertiesDrawer&quot; aria-expanded=&quot;false&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m12 3 10 5-10 5L2 8Zm-9 10 9 5 9-5M3 18l9 5 9-5&quot;\/&gt;&lt;\/svg&gt;&lt;span id=&quot;mobilePropertiesLabel&quot;&gt;\u5207\u7247&lt;\/span&gt; &lt;span id=&quot;mobileCutCount&quot;&gt;0&lt;\/span&gt;&lt;\/button&gt;&lt;\/div&gt;&lt;\/div&gt;\r\n&lt;details class=&quot;selection-advanced&quot;&gt;&lt;summary&gt;\u66f4\u591a\u9009\u533a\u64cd\u4f5c&lt;\/summary&gt;&lt;div class=&quot;button-row&quot;&gt;&lt;button id=&quot;cropSelection&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M5 3v15h16M3 7h14v14&quot;\/&gt;&lt;\/svg&gt;\u6309\u9009\u533a\u88c1\u526a\u539f\u56fe&lt;\/button&gt;&lt;button id=&quot;extractSelection&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m12 3 10 5-10 5L2 8Zm-9 10 9 5 9-5M3 18l9 5 9-5&quot;\/&gt;&lt;\/svg&gt;\u63d0\u53d6\u4e3a\u6392\u7248\u56fe\u5c42&lt;\/button&gt;&lt;button id=&quot;mosaicSelection&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;3&quot; width=&quot;18&quot; height=&quot;18&quot; rx=&quot;2&quot;\/&gt;&lt;path d=&quot;M9 3v18M15 3v18M3 9h18M3 15h18&quot;\/&gt;&lt;\/svg&gt;\u9009\u533a\u9a6c\u8d5b\u514b&lt;\/button&gt;&lt;\/div&gt;&lt;\/details&gt;\r\n&lt;div class=&quot;stage-bottom&quot;&gt;&lt;button id=&quot;compareOriginal&quot; title=&quot;\u6309\u4f4f\u67e5\u770b\u6240\u9009\u56fe\u7247\u539f\u56fe&quot; aria-pressed=&quot;false&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M12 3v18M5 4h3M5 4v16h3M16 4h3v16h-3&quot;\/&gt;&lt;\/svg&gt;\u6309\u4f4f\u5bf9\u6bd4&lt;\/button&gt;&lt;div class=&quot;zoom-controls&quot;&gt;&lt;button id=&quot;zoomOut&quot; aria-label=&quot;\u7f29\u5c0f\u753b\u5e03&quot;&gt;\u2212&lt;\/button&gt;&lt;span id=&quot;zoomValue&quot;&gt;\u9002\u5e94&lt;\/span&gt;&lt;button id=&quot;zoomIn&quot; aria-label=&quot;\u653e\u5927\u753b\u5e03&quot;&gt;\uff0b&lt;\/button&gt;&lt;button id=&quot;fit&quot;&gt;\u9002\u5e94\u7a97\u53e3&lt;\/button&gt;&lt;\/div&gt;&lt;button id=&quot;showLayers&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m12 3 10 5-10 5L2 8Zm-9 10 9 5 9-5M3 18l9 5 9-5&quot;\/&gt;&lt;\/svg&gt;\u56fe\u5c42\u4e0e\u539f\u56fe&lt;\/button&gt;&lt;\/div&gt;&lt;div id=&quot;downloads&quot; class=&quot;downloads&quot; hidden&gt;&lt;\/div&gt;&lt;\/section&gt;&lt;\/section&gt;&lt;div id=&quot;drawerBackdrop&quot; class=&quot;drawer-backdrop&quot; hidden&gt;&lt;\/div&gt;&lt;dialog id=&quot;assetPreviewDialog&quot; aria-label=&quot;\u7d20\u6750\u9884\u89c8&quot;&gt;&lt;div class=&quot;dialog-head&quot;&gt;&lt;h2 id=&quot;assetPreviewTitle&quot;&gt;\u7d20\u6750\u9884\u89c8&lt;\/h2&gt;&lt;button id=&quot;assetPreviewClose&quot; class=&quot;icon-btn&quot; aria-label=&quot;\u5173\u95ed\u9884\u89c8&quot;&gt;\u00d7&lt;\/button&gt;&lt;\/div&gt;&lt;div id=&quot;assetPreviewContent&quot;&gt;&lt;\/div&gt;&lt;p id=&quot;assetPreviewHint&quot; class=&quot;hint&quot;&gt;&lt;\/p&gt;&lt;\/dialog&gt;&lt;dialog id=&quot;exportDialog&quot;&gt;&lt;div class=&quot;dialog-form&quot;&gt;&lt;div class=&quot;dialog-head&quot;&gt;&lt;h2&gt;\u5bfc\u51fa\u56fe\u7247 \u00b7 \u683c\u5f0f\u4e0e\u538b\u7f29&lt;\/h2&gt;&lt;button class=&quot;icon-btn dialog-close&quot; type=&quot;button&quot; aria-label=&quot;\u5173\u95ed&quot;&gt;\u00d7&lt;\/button&gt;&lt;\/div&gt;&lt;label class=&quot;field&quot;&gt;\u5bfc\u51fa\u8303\u56f4&lt;select id=&quot;exportTarget&quot;&gt;&lt;option value=&quot;scene&quot;&gt;\u6574\u5f20\u753b\u5e03 \/ \u6d77\u62a5&lt;\/option&gt;&lt;option value=&quot;layer&quot;&gt;\u4ec5\u9009\u4e2d\u7684\u56fe\u7247\u6216\u56fe\u5c42&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;p id=&quot;exportSourceInfo&quot; class=&quot;hint&quot;&gt;&lt;\/p&gt;&lt;label class=&quot;field&quot;&gt;\u6587\u4ef6\u540d&lt;input id=&quot;exportName&quot; type=&quot;text&quot; value=&quot;\u95ea\u5f97\u7d20\u6750-\u56fe\u7247&quot;&gt;&lt;\/label&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u683c\u5f0f&lt;select id=&quot;exportFormat&quot;&gt;&lt;option value=&quot;png&quot;&gt;PNG\uff08\u4fdd\u7559\u900f\u660e\uff09&lt;\/option&gt;&lt;option value=&quot;jpeg&quot;&gt;JPG&lt;\/option&gt;&lt;option value=&quot;webp&quot;&gt;WebP&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;JPG \/ WebP\u6700\u9ad8\u8d28\u91cf&lt;input id=&quot;exportQuality&quot; type=&quot;number&quot; min=&quot;10&quot; max=&quot;100&quot; value=&quot;90&quot;&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u538b\u7f29\u65b9\u5f0f&lt;select id=&quot;exportCompression&quot;&gt;&lt;option value=&quot;quality&quot;&gt;\u6309\u8d28\u91cf&lt;\/option&gt;&lt;option value=&quot;target&quot;&gt;\u9650\u5236\u6587\u4ef6\u5927\u5c0f\uff08\u4ec5\u8c03\u6574\u8d28\u91cf\uff09&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u76ee\u6807\u5927\u5c0f\uff08KB\uff09&lt;input id=&quot;exportTargetKB&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;100000&quot; value=&quot;500&quot; disabled&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;p id=&quot;exportQualityHint&quot; class=&quot;hint&quot;&gt;&lt;\/p&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u8f93\u51fa\u6700\u5927\u5bbd\u5ea6&lt;input id=&quot;exportWidth&quot; type=&quot;number&quot; min=&quot;0&quot; max=&quot;8192&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u8f93\u51fa\u6700\u5927\u9ad8\u5ea6&lt;input id=&quot;exportHeight&quot; type=&quot;number&quot; min=&quot;0&quot; max=&quot;8192&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;label class=&quot;check&quot;&gt;&lt;input id=&quot;exportHD&quot; type=&quot;checkbox&quot;&gt;\u4f1a\u5458\u9ad8\u6e05\uff1a\u4fdd\u7559\u539f\u5c3a\u5bf8 \/ \u66f4\u9ad8\u8d28\u91cf&lt;\/label&gt;&lt;p id=&quot;exportHint&quot; class=&quot;hint&quot;&gt;\u514d\u8d39\u5355\u56fe\uff1aPNG\/JPG\/WebP\uff0c\u6700\u957f\u8fb92048\u50cf\u7d20\uff0cJPG\/WebP\u8d28\u91cf\u6700\u9ad890\u3002\u4f1a\u5458\u652f\u6301\u539f\u5c3a\u5bf8\u4e0e\u66f4\u9ad8\u8d28\u91cf\uff1b\u59cb\u7ec8\u4fdd\u6301\u6bd4\u4f8b\uff0c\u53ea\u7f29\u5c0f\u4e0d\u653e\u5927\u3002\u586b0\u4e0d\u53e6\u8bbe\u8f93\u51fa\u5c3a\u5bf8\u3002&lt;\/p&gt;&lt;figure style=&quot;margin:12px 0&quot;&gt;&lt;img id=&quot;exportPreview&quot; alt=&quot;\u5b9e\u9645\u7f16\u7801\u540e\u7684\u5bfc\u51fa\u9884\u89c8&quot; hidden style=&quot;display:block;max-width:100%;max-height:220px;margin:auto;background:repeating-conic-gradient(#eee 0% 25%,#fff 0% 50%) 0\/16px 16px&quot;&gt;&lt;figcaption id=&quot;exportEncodedInfo&quot; class=&quot;hint&quot; role=&quot;status&quot; aria-live=&quot;polite&quot;&gt;\u6b63\u5728\u51c6\u5907\u5b9e\u9645\u7f16\u7801\u9884\u89c8\u2026&lt;\/figcaption&gt;&lt;\/figure&gt;&lt;div class=&quot;dialog-actions&quot;&gt;&lt;button id=&quot;refreshExportPreview&quot; type=&quot;button&quot;&gt;\u91cd\u65b0\u751f\u6210\u9884\u89c8&lt;\/button&gt;&lt;button id=&quot;exportScene&quot; type=&quot;button&quot; class=&quot;primary&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M12 3v13m-5-5 5 5 5-5M4 16v5h16v-5&quot;\/&gt;&lt;\/svg&gt;\u5bfc\u51fa\u5e76\u4e0b\u8f7d&lt;\/button&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/dialog&gt;\r\n&lt;dialog id=&quot;vectorDialog&quot; aria-labelledby=&quot;vectorDialogTitle&quot;&gt;&lt;div class=&quot;dialog-head&quot;&gt;&lt;h2 id=&quot;vectorDialogTitle&quot;&gt;\u4f4d\u56fe\u8f6c SVG&lt;\/h2&gt;&lt;button id=&quot;vectorClose&quot; class=&quot;icon-btn&quot; type=&quot;button&quot; aria-label=&quot;\u5173\u95ed\u77e2\u91cf\u63cf\u6479&quot;&gt;\u00d7&lt;\/button&gt;&lt;\/div&gt;&lt;p class=&quot;hint&quot;&gt;\u9002\u5408\u6807\u5fd7\u3001\u7ebf\u7a3f\u548c\u7b80\u5355\u8272\u5757\u3002\u4fdd\u7559\u539f\u56fe\u4e0e\u5f53\u524d\u4f5c\u54c1\uff0c\u7167\u7247\u548c\u6e10\u53d8\u53ef\u80fd\u53d8\u6210\u8272\u5757\u3002\u5206\u6790\u6700\u957f\u8fb9 512 \u50cf\u7d20\uff0c\u653e\u5927 SVG \u4e0d\u4f1a\u6062\u590d\u539f\u56fe\u6ca1\u6709\u7684\u7ec6\u8282\u3002&lt;\/p&gt;&lt;div class=&quot;vector-options&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u63cf\u6479\u6765\u6e90&lt;select id=&quot;vectorSource&quot;&gt;&lt;option value=&quot;layer&quot;&gt;\u5f53\u524d\u56fe\u7247\u56fe\u5c42&lt;\/option&gt;&lt;option value=&quot;scene&quot;&gt;\u6574\u5f20\u753b\u5e03&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u6700\u591a\u989c\u8272&lt;select id=&quot;vectorColors&quot;&gt;&lt;option value=&quot;2&quot;&gt;2 \u8272&lt;\/option&gt;&lt;option value=&quot;4&quot;&gt;4 \u8272&lt;\/option&gt;&lt;option value=&quot;8&quot; selected&gt;8 \u8272&lt;\/option&gt;&lt;option value=&quot;16&quot;&gt;16 \u8272&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u7ec6\u8282&lt;select id=&quot;vectorDetail&quot;&gt;&lt;option value=&quot;simple&quot;&gt;\u7b80\u6d01 \u00b7 384 px&lt;\/option&gt;&lt;option value=&quot;fine&quot; selected&gt;\u7cbe\u7ec6 \u00b7 512 px&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;div class=&quot;vector-preview-pair&quot;&gt;&lt;figure&gt;&lt;figcaption&gt;\u539f\u56fe\u7f29\u7565\u9884\u89c8&lt;\/figcaption&gt;&lt;div class=&quot;vector-preview-surface&quot;&gt;&lt;img id=&quot;vectorOriginalPreview&quot; alt=&quot;\u63cf\u6479\u524d\u7684\u539f\u56fe\u7f29\u7565\u9884\u89c8&quot; hidden&gt;&lt;\/div&gt;&lt;\/figure&gt;&lt;figure&gt;&lt;figcaption&gt;\u77e2\u91cf\u7ed3\u679c\u9884\u89c8&lt;\/figcaption&gt;&lt;div class=&quot;vector-preview-surface&quot;&gt;&lt;img id=&quot;vectorResultPreview&quot; alt=&quot;\u751f\u6210\u7684\u77e2\u91cf\u8def\u5f84\u9884\u89c8&quot; hidden&gt;&lt;\/div&gt;&lt;\/figure&gt;&lt;\/div&gt;&lt;p id=&quot;vectorStatus&quot; class=&quot;hint&quot; role=&quot;status&quot; aria-live=&quot;polite&quot;&gt;\u70b9\u51fb\u751f\u6210\u9884\u89c8\u3002&lt;\/p&gt;&lt;div class=&quot;dialog-actions&quot;&gt;&lt;button id=&quot;vectorGenerate&quot; type=&quot;button&quot; class=&quot;primary&quot;&gt;\u751f\u6210\u9884\u89c8&lt;\/button&gt;&lt;button id=&quot;vectorCancel&quot; type=&quot;button&quot; hidden&gt;\u53d6\u6d88\u8ba1\u7b97&lt;\/button&gt;&lt;button id=&quot;vectorDownload&quot; type=&quot;button&quot; disabled&gt;\u4e0b\u8f7d SVG&lt;span class=&quot;member-badge&quot; aria-label=&quot;\u4f1a\u5458\u529f\u80fd&quot;&gt;\u4f1a\u5458&lt;\/span&gt;&lt;\/button&gt;&lt;\/div&gt;&lt;p class=&quot;hint&quot;&gt;\u672c\u673a\u5904\u7406\uff0c\u65e0\u9700\u4e0a\u4f20\u56fe\u7247\u3002\u5bfc\u51fa\u4e3a\u72ec\u7acb SVG \u6587\u4ef6\uff0c\u6587\u5b57\u5c06\u6210\u4e3a\u56fe\u5f62\u8f6e\u5ed3\u3002&lt;\/p&gt;&lt;\/dialog&gt;\r\n&lt;dialog id=&quot;batchDialog&quot;&gt;&lt;div class=&quot;dialog-form&quot;&gt;&lt;div class=&quot;dialog-head&quot;&gt;&lt;h2&gt;\u6279\u91cf\u5c3a\u5bf8 \/ \u683c\u5f0f \/ \u538b\u7f29&lt;\/h2&gt;&lt;button class=&quot;icon-btn dialog-close&quot; type=&quot;button&quot; aria-label=&quot;\u5173\u95ed&quot;&gt;\u00d7&lt;\/button&gt;&lt;\/div&gt;&lt;p class=&quot;hint&quot;&gt;\u5bf9\u56fe\u7247\u672c\u8eab\u7684\u5f53\u524d\u7f16\u8f91\u7ed3\u679c\u7edf\u4e00\u5c3a\u5bf8\uff0c\u4fdd\u6301\u957f\u5bbd\u6bd4\u4f8b\uff1b\u4e0d\u542b\u753b\u5e03\u6392\u7248\u6548\u679c\u3002\u5c3a\u5bf8\u586b0\u5373\u4fdd\u6301\u539f\u5c3a\u5bf8\u3002PNG\u4e3a\u65e0\u635f\u683c\u5f0f\uff0c\u4e0d\u4f7f\u7528\u8d28\u91cf\u53c2\u6570\uff1b\u653e\u5927\u4e0d\u4f1a\u589e\u52a0\u539f\u56fe\u7ec6\u8282\u3002&lt;\/p&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u6700\u5927\u5bbd&lt;input id=&quot;batchW&quot; type=&quot;number&quot; min=&quot;0&quot; max=&quot;8192&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u6700\u5927\u9ad8&lt;input id=&quot;batchH&quot; type=&quot;number&quot; min=&quot;0&quot; max=&quot;8192&quot; value=&quot;0&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u683c\u5f0f&lt;select id=&quot;batchFormat&quot;&gt;&lt;option value=&quot;png&quot;&gt;PNG&lt;\/option&gt;&lt;option value=&quot;jpeg&quot;&gt;JPG&lt;\/option&gt;&lt;option value=&quot;webp&quot;&gt;WebP&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;JPG \/ WebP\u8d28\u91cf&lt;input id=&quot;batchQuality&quot; type=&quot;number&quot; min=&quot;10&quot; max=&quot;100&quot; value=&quot;85&quot;&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;label class=&quot;check&quot;&gt;&lt;input id=&quot;batchUpscale&quot; type=&quot;checkbox&quot;&gt;\u5141\u8bb8\u653e\u5927&lt;\/label&gt;&lt;div class=&quot;dialog-actions&quot;&gt;&lt;button id=&quot;batchExport&quot; type=&quot;button&quot; class=&quot;primary&quot;&gt;&lt;svg class=&quot;button-icon&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M12 3v13m-5-5 5 5 5-5M4 16v5h16v-5&quot;\/&gt;&lt;\/svg&gt;\u4e0b\u8f7d\u5168\u90e8\u56fe\u7247ZIP&lt;\/button&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/dialog&gt;\r\n&lt;dialog id=&quot;replaceDraftDialog&quot;&gt;&lt;div class=&quot;dialog-head&quot;&gt;&lt;h2&gt;\u66ff\u6362\u5df2\u6709\u672c\u673a\u8349\u7a3f\uff1f&lt;\/h2&gt;&lt;\/div&gt;&lt;p class=&quot;hint&quot;&gt;\u5f53\u524d\u6d4f\u89c8\u5668\u5df2\u6709\u4e00\u4efd\u8349\u7a3f\u3002\u66ff\u6362\u540e\u4f1a\u81ea\u52a8\u4fdd\u5b58\u5f53\u524d\u4f5c\u54c1\u5e76\u8986\u76d6\u65e7\u8349\u7a3f\u3002\u9700\u8981\u4fdd\u7559\u65e7\u4f5c\u54c1\uff0c\u8bf7\u5148\u6062\u590d\u5e76\u4e0b\u8f7d\u9879\u76ee\u6587\u4ef6\u3002&lt;\/p&gt;&lt;div class=&quot;dialog-actions&quot;&gt;&lt;button id=&quot;replaceDraftCancel&quot; type=&quot;button&quot;&gt;\u4fdd\u7559\u65e7\u8349\u7a3f&lt;\/button&gt;&lt;button id=&quot;replaceDraftConfirm&quot; type=&quot;button&quot; class=&quot;primary&quot;&gt;\u66ff\u6362\u5e76\u5f00\u542f\u81ea\u52a8\u4fdd\u5b58&lt;\/button&gt;&lt;\/div&gt;&lt;\/dialog&gt;&lt;dialog id=&quot;replaceProjectDialog&quot; aria-labelledby=&quot;replaceProjectTitle&quot;&gt;&lt;div class=&quot;dialog-head&quot;&gt;&lt;h2 id=&quot;replaceProjectTitle&quot;&gt;\u66ff\u6362\u5f53\u524d\u9879\u76ee\uff1f&lt;\/h2&gt;&lt;\/div&gt;&lt;p class=&quot;hint&quot;&gt;\u5f53\u524d\u6709\u672a\u4fdd\u5b58\u7684\u4fee\u6539\u3002\u8bf7\u5148\u4fdd\u5b58\u9879\u76ee\u6216\u8349\u7a3f\uff0c\u518d\u6253\u5f00\u5176\u4ed6\u9879\u76ee\u3002&lt;\/p&gt;&lt;div class=&quot;dialog-actions&quot;&gt;&lt;button id=&quot;replaceProjectCancel&quot; type=&quot;button&quot;&gt;\u7ee7\u7eed\u7f16\u8f91&lt;\/button&gt;&lt;button id=&quot;replaceProjectConfirm&quot; type=&quot;button&quot; class=&quot;primary&quot;&gt;\u66ff\u6362\u9879\u76ee&lt;\/button&gt;&lt;\/div&gt;&lt;\/dialog&gt;&lt;dialog id=&quot;newCanvasDialog&quot;&gt;&lt;div class=&quot;dialog-head&quot;&gt;&lt;h2&gt;\u65b0\u5efa\u8bbe\u8ba1&lt;\/h2&gt;&lt;button class=&quot;icon-btn dialog-close&quot; type=&quot;button&quot; aria-label=&quot;\u5173\u95ed&quot;&gt;\u00d7&lt;\/button&gt;&lt;\/div&gt;&lt;label class=&quot;field&quot;&gt;\u5e38\u7528\u5c3a\u5bf8&lt;select id=&quot;newPreset&quot;&gt;&lt;option value=&quot;1080x1440&quot;&gt;\u7ad6\u7248\u6d77\u62a5 \u00b7 1080 \u00d7 1440&lt;\/option&gt;&lt;option value=&quot;1200x1200&quot;&gt;\u6b63\u65b9\u5f62 \u00b7 1200 \u00d7 1200&lt;\/option&gt;&lt;option value=&quot;1920x1080&quot;&gt;\u6a2a\u7248\u5c55\u793a \u00b7 1920 \u00d7 1080&lt;\/option&gt;&lt;option value=&quot;1080x1920&quot;&gt;\u624b\u673a\u957f\u56fe \u00b7 1080 \u00d7 1920&lt;\/option&gt;&lt;option value=&quot;2480x3508&quot;&gt;A4 \u7ad6\u7248 \u00b7 2480 \u00d7 3508&lt;\/option&gt;&lt;option value=&quot;custom&quot;&gt;\u81ea\u5b9a\u4e49&lt;\/option&gt;&lt;\/select&gt;&lt;\/label&gt;&lt;div class=&quot;grid2&quot;&gt;&lt;label class=&quot;field&quot;&gt;\u5bbd\u5ea6\uff08px\uff09&lt;input id=&quot;newCanvasW&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;8192&quot; value=&quot;1080&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;field&quot;&gt;\u9ad8\u5ea6\uff08px\uff09&lt;input id=&quot;newCanvasH&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;8192&quot; value=&quot;1440&quot;&gt;&lt;\/label&gt;&lt;\/div&gt;&lt;label class=&quot;field&quot;&gt;\u80cc\u666f\u989c\u8272&lt;input id=&quot;newCanvasBg&quot; type=&quot;color&quot; value=&quot;#ffffff&quot;&gt;&lt;\/label&gt;&lt;label class=&quot;check&quot;&gt;&lt;input id=&quot;newTransparent&quot; type=&quot;checkbox&quot;&gt;\u900f\u660e\u80cc\u666f&lt;\/label&gt;&lt;p class=&quot;hint&quot;&gt;\u65b0\u8bbe\u8ba1\u4f1a\u66ff\u6362\u5f53\u524d\u9879\u76ee\u548c\u5207\u7247\uff0c\u8bf7\u5148\u4fdd\u5b58\u3002\u5bfc\u5165\u56fe\u7247\u4f1a\u9002\u5e94\u4f60\u9009\u5b9a\u7684\u753b\u5e03\uff0c\u753b\u5e03\u5c3a\u5bf8\u4fdd\u6301\u4e0d\u53d8\u3002&lt;\/p&gt;&lt;div class=&quot;dialog-actions&quot;&gt;&lt;button type=&quot;button&quot; class=&quot;dialog-close&quot;&gt;\u7ee7\u7eed\u7f16\u8f91&lt;\/button&gt;&lt;button id=&quot;confirmNewCanvas&quot; type=&quot;button&quot; class=&quot;primary&quot;&gt;\u521b\u5efa\u8bbe\u8ba1&lt;\/button&gt;&lt;\/div&gt;&lt;\/dialog&gt;&lt;\/main&gt;&lt;script&gt;\/*!\r\n\r\nJSZip v3.10.1 - A JavaScript class for generating and reading zip files\r\n&lt;http:\/\/stuartk.com\/jszip&gt;\r\n\r\n(c) 2009-2016 Stuart Knightley &lt;stuart [at] stuartk.com&gt;\r\nDual licenced under the MIT license or GPLv3. See https:\/\/raw.github.com\/Stuk\/jszip\/main\/LICENSE.markdown.\r\n\r\nJSZip uses the library pako released under the MIT license :\r\nhttps:\/\/github.com\/nodeca\/pako\/blob\/main\/LICENSE\r\n*\/\r\n\r\n!function(e){if(&quot;object&quot;==typeof exports&amp;&amp;&quot;undefined&quot;!=typeof module)module.exports=e();else if(&quot;function&quot;==typeof define&amp;&amp;define.amd)define([],e);else{(&quot;undefined&quot;!=typeof window?window:&quot;undefined&quot;!=typeof global?global:&quot;undefined&quot;!=typeof self?self:this).JSZip=e()}}(function(){return function s(a,o,h){function u(r,e){if(!o[r]){if(!a[r]){var t=&quot;function&quot;==typeof require&amp;&amp;require;if(!e&amp;&amp;t)return t(r,!0);if(l)return l(r,!0);var n=new Error(&quot;Cannot find module &#039;&quot;+r+&quot;&#039;&quot;);throw n.code=&quot;MODULE_NOT_FOUND&quot;,n}var i=o[r]={exports:{}};a[r][0].call(i.exports,function(e){var t=a[r][1][e];return u(t||e)},i,i.exports,s,a,o,h)}return o[r].exports}for(var l=&quot;function&quot;==typeof require&amp;&amp;require,e=0;e&lt;h.length;e++)u(h[e]);return u}({1:[function(e,t,r){&quot;use strict&quot;;var d=e(&quot;.\/utils&quot;),c=e(&quot;.\/support&quot;),p=&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=&quot;;r.encode=function(e){for(var t,r,n,i,s,a,o,h=[],u=0,l=e.length,f=l,c=&quot;string&quot;!==d.getTypeOf(e);u&lt;e.length;)f=l-u,n=c?(t=e[u++],r=u&lt;l?e[u++]:0,u&lt;l?e[u++]:0):(t=e.charCodeAt(u++),r=u&lt;l?e.charCodeAt(u++):0,u&lt;l?e.charCodeAt(u++):0),i=t&gt;&gt;2,s=(3&amp;t)&lt;&lt;4|r&gt;&gt;4,a=1&lt;f?(15&amp;r)&lt;&lt;2|n&gt;&gt;6:64,o=2&lt;f?63&amp;n:64,h.push(p.charAt(i)+p.charAt(s)+p.charAt(a)+p.charAt(o));return h.join(&quot;&quot;)},r.decode=function(e){var t,r,n,i,s,a,o=0,h=0,u=&quot;data:&quot;;if(e.substr(0,u.length)===u)throw new Error(&quot;Invalid base64 input, it looks like a data url.&quot;);var l,f=3*(e=e.replace(\/[^A-Za-z0-9+\/=]\/g,&quot;&quot;)).length\/4;if(e.charAt(e.length-1)===p.charAt(64)&amp;&amp;f--,e.charAt(e.length-2)===p.charAt(64)&amp;&amp;f--,f%1!=0)throw new Error(&quot;Invalid base64 input, bad content length.&quot;);for(l=c.uint8array?new Uint8Array(0|f):new Array(0|f);o&lt;e.length;)t=p.indexOf(e.charAt(o++))&lt;&lt;2|(i=p.indexOf(e.charAt(o++)))&gt;&gt;4,r=(15&amp;i)&lt;&lt;4|(s=p.indexOf(e.charAt(o++)))&gt;&gt;2,n=(3&amp;s)&lt;&lt;6|(a=p.indexOf(e.charAt(o++))),l[h++]=t,64!==s&amp;&amp;(l[h++]=r),64!==a&amp;&amp;(l[h++]=n);return l}},{&quot;.\/support&quot;:30,&quot;.\/utils&quot;:32}],2:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;.\/external&quot;),i=e(&quot;.\/stream\/DataWorker&quot;),s=e(&quot;.\/stream\/Crc32Probe&quot;),a=e(&quot;.\/stream\/DataLengthProbe&quot;);function o(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}o.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a(&quot;data_length&quot;)),t=this;return e.on(&quot;end&quot;,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error(&quot;Bug : uncompressed data size mismatch&quot;)}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo(&quot;compressedSize&quot;,this.compressedSize).withStreamInfo(&quot;uncompressedSize&quot;,this.uncompressedSize).withStreamInfo(&quot;crc32&quot;,this.crc32).withStreamInfo(&quot;compression&quot;,this.compression)}},o.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new a(&quot;uncompressedSize&quot;)).pipe(t.compressWorker(r)).pipe(new a(&quot;compressedSize&quot;)).withStreamInfo(&quot;compression&quot;,t)},t.exports=o},{&quot;.\/external&quot;:6,&quot;.\/stream\/Crc32Probe&quot;:25,&quot;.\/stream\/DataLengthProbe&quot;:26,&quot;.\/stream\/DataWorker&quot;:27}],3:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;.\/stream\/GenericWorker&quot;);r.STORE={magic:&quot;\\0\\0&quot;,compressWorker:function(){return new n(&quot;STORE compression&quot;)},uncompressWorker:function(){return new n(&quot;STORE decompression&quot;)}},r.DEFLATE=e(&quot;.\/flate&quot;)},{&quot;.\/flate&quot;:7,&quot;.\/stream\/GenericWorker&quot;:28}],4:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;.\/utils&quot;);var o=function(){for(var e,t=[],r=0;r&lt;256;r++){e=r;for(var n=0;n&lt;8;n++)e=1&amp;e?3988292384^e&gt;&gt;&gt;1:e&gt;&gt;&gt;1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&amp;&amp;e.length?&quot;string&quot;!==n.getTypeOf(e)?function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a&lt;s;a++)e=e&gt;&gt;&gt;8^i[255&amp;(e^t[a])];return-1^e}(0|t,e,e.length,0):function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a&lt;s;a++)e=e&gt;&gt;&gt;8^i[255&amp;(e^t.charCodeAt(a))];return-1^e}(0|t,e,e.length,0):0}},{&quot;.\/utils&quot;:32}],5:[function(e,t,r){&quot;use strict&quot;;r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){&quot;use strict&quot;;var n=null;n=&quot;undefined&quot;!=typeof Promise?Promise:e(&quot;lie&quot;),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){&quot;use strict&quot;;var n=&quot;undefined&quot;!=typeof Uint8Array&amp;&amp;&quot;undefined&quot;!=typeof Uint16Array&amp;&amp;&quot;undefined&quot;!=typeof Uint32Array,i=e(&quot;pako&quot;),s=e(&quot;.\/utils&quot;),a=e(&quot;.\/stream\/GenericWorker&quot;),o=n?&quot;uint8array&quot;:&quot;array&quot;;function h(e,t){a.call(this,&quot;FlateWorker\/&quot;+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic=&quot;\\b\\0&quot;,s.inherits(h,a),h.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&amp;&amp;this._createPako(),this._pako.push(s.transformTo(o,e.data),!1)},h.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&amp;&amp;this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(e){return new h(&quot;Deflate&quot;,e)},r.uncompressWorker=function(){return new h(&quot;Inflate&quot;,{})}},{&quot;.\/stream\/GenericWorker&quot;:28,&quot;.\/utils&quot;:32,pako:38}],8:[function(e,t,r){&quot;use strict&quot;;function A(e,t){var r,n=&quot;&quot;;for(r=0;r&lt;t;r++)n+=String.fromCharCode(255&amp;e),e&gt;&gt;&gt;=8;return n}function n(e,t,r,n,i,s){var a,o,h=e.file,u=e.compression,l=s!==O.utf8encode,f=I.transformTo(&quot;string&quot;,s(h.name)),c=I.transformTo(&quot;string&quot;,O.utf8encode(h.name)),d=h.comment,p=I.transformTo(&quot;string&quot;,s(d)),m=I.transformTo(&quot;string&quot;,O.utf8encode(d)),_=c.length!==h.name.length,g=m.length!==d.length,b=&quot;&quot;,v=&quot;&quot;,y=&quot;&quot;,w=h.dir,k=h.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&amp;&amp;!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var S=0;t&amp;&amp;(S|=8),l||!_&amp;&amp;!g||(S|=2048);var z=0,C=0;w&amp;&amp;(z|=16),&quot;UNIX&quot;===i?(C=798,z|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&amp;r)&lt;&lt;16}(h.unixPermissions,w)):(C=20,z|=function(e){return 63&amp;(e||0)}(h.dosPermissions)),a=k.getUTCHours(),a&lt;&lt;=6,a|=k.getUTCMinutes(),a&lt;&lt;=5,a|=k.getUTCSeconds()\/2,o=k.getUTCFullYear()-1980,o&lt;&lt;=4,o|=k.getUTCMonth()+1,o&lt;&lt;=5,o|=k.getUTCDate(),_&amp;&amp;(v=A(1,1)+A(B(f),4)+c,b+=&quot;up&quot;+A(v.length,2)+v),g&amp;&amp;(y=A(1,1)+A(B(p),4)+m,b+=&quot;uc&quot;+A(y.length,2)+y);var E=&quot;&quot;;return E+=&quot;\\n\\0&quot;,E+=A(S,2),E+=u.magic,E+=A(a,2),E+=A(o,2),E+=A(x.crc32,4),E+=A(x.compressedSize,4),E+=A(x.uncompressedSize,4),E+=A(f.length,2),E+=A(b.length,2),{fileRecord:R.LOCAL_FILE_HEADER+E+f+b,dirRecord:R.CENTRAL_FILE_HEADER+A(C,2)+E+A(p.length,2)+&quot;\\0\\0\\0\\0&quot;+A(z,4)+A(n,4)+f+b+p}}var I=e(&quot;..\/utils&quot;),i=e(&quot;..\/stream\/GenericWorker&quot;),O=e(&quot;..\/utf8&quot;),B=e(&quot;..\/crc32&quot;),R=e(&quot;..\/signature&quot;);function s(e,t,r,n){i.call(this,&quot;ZipFileWorker&quot;),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}I.inherits(s,i),s.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,i.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))\/r:100}}))},s.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&amp;&amp;!e.file.dir;if(t){var r=n(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},s.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&amp;&amp;!e.file.dir,r=n(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return R.DATA_DESCRIPTOR+A(e.crc32,4)+A(e.compressedSize,4)+A(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},s.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t&lt;this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,n=function(e,t,r,n,i){var s=I.transformTo(&quot;string&quot;,i(n));return R.CENTRAL_DIRECTORY_END+&quot;\\0\\0\\0\\0&quot;+A(e,2)+A(e,2)+A(t,4)+A(r,4)+A(s.length,2)+s}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})},s.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},s.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on(&quot;data&quot;,function(e){t.processChunk(e)}),e.on(&quot;end&quot;,function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on(&quot;error&quot;,function(e){t.error(e)}),this},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&amp;&amp;(!this.previous&amp;&amp;this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},s.prototype.error=function(e){var t=this._sources;if(!i.prototype.error.call(this,e))return!1;for(var r=0;r&lt;t.length;r++)try{t[r].error(e)}catch(e){}return!0},s.prototype.lock=function(){i.prototype.lock.call(this);for(var e=this._sources,t=0;t&lt;e.length;t++)e[t].lock()},t.exports=s},{&quot;..\/crc32&quot;:4,&quot;..\/signature&quot;:23,&quot;..\/stream\/GenericWorker&quot;:28,&quot;..\/utf8&quot;:31,&quot;..\/utils&quot;:32}],9:[function(e,t,r){&quot;use strict&quot;;var u=e(&quot;..\/compressions&quot;),n=e(&quot;.\/ZipFileWorker&quot;);r.generateWorker=function(e,a,t){var o=new n(a.streamFiles,t,a.platform,a.encodeFileName),h=0;try{e.forEach(function(e,t){h++;var r=function(e,t){var r=e||t,n=u[r];if(!n)throw new Error(r+&quot; is not a valid compression method !&quot;);return n}(t.options.compression,a.compression),n=t.options.compressionOptions||a.compressionOptions||{},i=t.dir,s=t.date;t._compressWorker(r,n).withStreamInfo(&quot;file&quot;,{name:e,dir:i,date:s,comment:t.comment||&quot;&quot;,unixPermissions:t.unixPermissions,dosPermissions:t.dosPermissions}).pipe(o)}),o.entriesCount=h}catch(e){o.error(e)}return o}},{&quot;..\/compressions&quot;:3,&quot;.\/ZipFileWorker&quot;:8}],10:[function(e,t,r){&quot;use strict&quot;;function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error(&quot;The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.&quot;);this.files=Object.create(null),this.comment=null,this.root=&quot;&quot;,this.clone=function(){var e=new n;for(var t in this)&quot;function&quot;!=typeof this[t]&amp;&amp;(e[t]=this[t]);return e}}(n.prototype=e(&quot;.\/object&quot;)).loadAsync=e(&quot;.\/load&quot;),n.support=e(&quot;.\/support&quot;),n.defaults=e(&quot;.\/defaults&quot;),n.version=&quot;3.10.1&quot;,n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=e(&quot;.\/external&quot;),t.exports=n},{&quot;.\/defaults&quot;:5,&quot;.\/external&quot;:6,&quot;.\/load&quot;:11,&quot;.\/object&quot;:15,&quot;.\/support&quot;:30}],11:[function(e,t,r){&quot;use strict&quot;;var u=e(&quot;.\/utils&quot;),i=e(&quot;.\/external&quot;),n=e(&quot;.\/utf8&quot;),s=e(&quot;.\/zipEntries&quot;),a=e(&quot;.\/stream\/Crc32Probe&quot;),l=e(&quot;.\/nodejsUtils&quot;);function f(n){return new i.Promise(function(e,t){var r=n.decompressed.getContentWorker().pipe(new a);r.on(&quot;error&quot;,function(e){t(e)}).on(&quot;end&quot;,function(){r.streamInfo.crc32!==n.decompressed.crc32?t(new Error(&quot;Corrupted zip : CRC32 mismatch&quot;)):e()}).resume()})}t.exports=function(e,o){var h=this;return o=u.extend(o||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:n.utf8decode}),l.isNode&amp;&amp;l.isStream(e)?i.Promise.reject(new Error(&quot;JSZip can&#039;t accept a stream when loading a zip file.&quot;)):u.prepareContent(&quot;the loaded zip file&quot;,e,!0,o.optimizedBinaryString,o.base64).then(function(e){var t=new s(o);return t.load(e),t}).then(function(e){var t=[i.Promise.resolve(e)],r=e.files;if(o.checkCRC32)for(var n=0;n&lt;r.length;n++)t.push(f(r[n]));return i.Promise.all(t)}).then(function(e){for(var t=e.shift(),r=t.files,n=0;n&lt;r.length;n++){var i=r[n],s=i.fileNameStr,a=u.resolve(i.fileNameStr);h.file(a,i.decompressed,{binary:!0,optimizedBinaryString:!0,date:i.date,dir:i.dir,comment:i.fileCommentStr.length?i.fileCommentStr:null,unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions,createFolders:o.createFolders}),i.dir||(h.file(a).unsafeOriginalName=s)}return t.zipComment.length&amp;&amp;(h.comment=t.zipComment),h})}},{&quot;.\/external&quot;:6,&quot;.\/nodejsUtils&quot;:14,&quot;.\/stream\/Crc32Probe&quot;:25,&quot;.\/utf8&quot;:31,&quot;.\/utils&quot;:32,&quot;.\/zipEntries&quot;:33}],12:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;..\/utils&quot;),i=e(&quot;..\/stream\/GenericWorker&quot;);function s(e,t){i.call(this,&quot;Nodejs stream input adapter for &quot;+e),this._upstreamEnded=!1,this._bindStream(t)}n.inherits(s,i),s.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on(&quot;data&quot;,function(e){t.push({data:e,meta:{percent:0}})}).on(&quot;error&quot;,function(e){t.isPaused?this.generatedError=e:t.error(e)}).on(&quot;end&quot;,function(){t.isPaused?t._upstreamEnded=!0:t.end()})},s.prototype.pause=function(){return!!i.prototype.pause.call(this)&amp;&amp;(this._stream.pause(),!0)},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&amp;&amp;(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=s},{&quot;..\/stream\/GenericWorker&quot;:28,&quot;..\/utils&quot;:32}],13:[function(e,t,r){&quot;use strict&quot;;var i=e(&quot;readable-stream&quot;).Readable;function n(e,t,r){i.call(this,t),this._helper=e;var n=this;e.on(&quot;data&quot;,function(e,t){n.push(e)||n._helper.pause(),r&amp;&amp;r(t)}).on(&quot;error&quot;,function(e){n.emit(&quot;error&quot;,e)}).on(&quot;end&quot;,function(){n.push(null)})}e(&quot;..\/utils&quot;).inherits(n,i),n.prototype._read=function(){this._helper.resume()},t.exports=n},{&quot;..\/utils&quot;:32,&quot;readable-stream&quot;:16}],14:[function(e,t,r){&quot;use strict&quot;;t.exports={isNode:&quot;undefined&quot;!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&amp;&amp;Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if(&quot;number&quot;==typeof e)throw new Error(&#039;The &quot;data&quot; argument must not be a number&#039;);return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&amp;&amp;&quot;function&quot;==typeof e.on&amp;&amp;&quot;function&quot;==typeof e.pause&amp;&amp;&quot;function&quot;==typeof e.resume}}},{}],15:[function(e,t,r){&quot;use strict&quot;;function s(e,t,r){var n,i=u.getTypeOf(t),s=u.extend(r||{},f);s.date=s.date||new Date,null!==s.compression&amp;&amp;(s.compression=s.compression.toUpperCase()),&quot;string&quot;==typeof s.unixPermissions&amp;&amp;(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&amp;&amp;16384&amp;s.unixPermissions&amp;&amp;(s.dir=!0),s.dosPermissions&amp;&amp;16&amp;s.dosPermissions&amp;&amp;(s.dir=!0),s.dir&amp;&amp;(e=g(e)),s.createFolders&amp;&amp;(n=_(e))&amp;&amp;b.call(this,n,!0);var a=&quot;string&quot;===i&amp;&amp;!1===s.binary&amp;&amp;!1===s.base64;r&amp;&amp;void 0!==r.binary||(s.binary=!a),(t instanceof c&amp;&amp;0===t.uncompressedSize||s.dir||!t||0===t.length)&amp;&amp;(s.base64=!1,s.binary=!0,t=&quot;&quot;,s.compression=&quot;STORE&quot;,i=&quot;string&quot;);var o=null;o=t instanceof c||t instanceof l?t:p.isNode&amp;&amp;p.isStream(t)?new m(e,t):u.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var h=new d(e,o,s);this.files[e]=h}var i=e(&quot;.\/utf8&quot;),u=e(&quot;.\/utils&quot;),l=e(&quot;.\/stream\/GenericWorker&quot;),a=e(&quot;.\/stream\/StreamHelper&quot;),f=e(&quot;.\/defaults&quot;),c=e(&quot;.\/compressedObject&quot;),d=e(&quot;.\/zipObject&quot;),o=e(&quot;.\/generate&quot;),p=e(&quot;.\/nodejsUtils&quot;),m=e(&quot;.\/nodejs\/NodejsStreamInputAdapter&quot;),_=function(e){&quot;\/&quot;===e.slice(-1)&amp;&amp;(e=e.substring(0,e.length-1));var t=e.lastIndexOf(&quot;\/&quot;);return 0&lt;t?e.substring(0,t):&quot;&quot;},g=function(e){return&quot;\/&quot;!==e.slice(-1)&amp;&amp;(e+=&quot;\/&quot;),e},b=function(e,t){return t=void 0!==t?t:f.createFolders,e=g(e),this.files[e]||s.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function h(e){return&quot;[object RegExp]&quot;===Object.prototype.toString.call(e)}var n={load:function(){throw new Error(&quot;This method has been removed in JSZip 3.0, please check the upgrade guide.&quot;)},forEach:function(e){var t,r,n;for(t in this.files)n=this.files[t],(r=t.slice(this.root.length,t.length))&amp;&amp;t.slice(0,this.root.length)===this.root&amp;&amp;e(r,n)},filter:function(r){var n=[];return this.forEach(function(e,t){r(e,t)&amp;&amp;n.push(t)}),n},file:function(e,t,r){if(1!==arguments.length)return e=this.root+e,s.call(this,e,t,r),this;if(h(e)){var n=e;return this.filter(function(e,t){return!t.dir&amp;&amp;n.test(e)})}var i=this.files[this.root+e];return i&amp;&amp;!i.dir?i:null},folder:function(r){if(!r)return this;if(h(r))return this.filter(function(e,t){return t.dir&amp;&amp;r.test(e)});var e=this.root+r,t=b.call(this,e),n=this.clone();return n.root=t.name,n},remove:function(r){r=this.root+r;var e=this.files[r];if(e||(&quot;\/&quot;!==r.slice(-1)&amp;&amp;(r+=&quot;\/&quot;),e=this.files[r]),e&amp;&amp;!e.dir)delete this.files[r];else for(var t=this.filter(function(e,t){return t.name.slice(0,r.length)===r}),n=0;n&lt;t.length;n++)delete this.files[t[n].name];return this},generate:function(){throw new Error(&quot;This method has been removed in JSZip 3.0, please check the upgrade guide.&quot;)},generateInternalStream:function(e){var t,r={};try{if((r=u.extend(e||{},{streamFiles:!1,compression:&quot;STORE&quot;,compressionOptions:null,type:&quot;&quot;,platform:&quot;DOS&quot;,comment:null,mimeType:&quot;application\/zip&quot;,encodeFileName:i.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),&quot;binarystring&quot;===r.type&amp;&amp;(r.type=&quot;string&quot;),!r.type)throw new Error(&quot;No output type specified.&quot;);u.checkSupport(r.type),&quot;darwin&quot;!==r.platform&amp;&amp;&quot;freebsd&quot;!==r.platform&amp;&amp;&quot;linux&quot;!==r.platform&amp;&amp;&quot;sunos&quot;!==r.platform||(r.platform=&quot;UNIX&quot;),&quot;win32&quot;===r.platform&amp;&amp;(r.platform=&quot;DOS&quot;);var n=r.comment||this.comment||&quot;&quot;;t=o.generateWorker(this,r,n)}catch(e){(t=new l(&quot;error&quot;)).error(e)}return new a(t,r.type||&quot;string&quot;,r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type=&quot;nodebuffer&quot;),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=n},{&quot;.\/compressedObject&quot;:2,&quot;.\/defaults&quot;:5,&quot;.\/generate&quot;:9,&quot;.\/nodejs\/NodejsStreamInputAdapter&quot;:12,&quot;.\/nodejsUtils&quot;:14,&quot;.\/stream\/GenericWorker&quot;:28,&quot;.\/stream\/StreamHelper&quot;:29,&quot;.\/utf8&quot;:31,&quot;.\/utils&quot;:32,&quot;.\/zipObject&quot;:35}],16:[function(e,t,r){&quot;use strict&quot;;t.exports=e(&quot;stream&quot;)},{stream:void 0}],17:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;.\/DataReader&quot;);function i(e){n.call(this,e);for(var t=0;t&lt;this.data.length;t++)e[t]=255&amp;e[t]}e(&quot;..\/utils&quot;).inherits(i,n),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),s=this.length-4;0&lt;=s;--s)if(this.data[s]===t&amp;&amp;this.data[s+1]===r&amp;&amp;this.data[s+2]===n&amp;&amp;this.data[s+3]===i)return s-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),s=this.readData(4);return t===s[0]&amp;&amp;r===s[1]&amp;&amp;n===s[2]&amp;&amp;i===s[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{&quot;..\/utils&quot;:32,&quot;.\/DataReader&quot;:18}],18:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;..\/utils&quot;);function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length&lt;this.zero+e||e&lt;0)throw new Error(&quot;End of data reached (data length = &quot;+this.length+&quot;, asked index = &quot;+e+&quot;). Corrupted zip ?&quot;)},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t&gt;=this.index;t--)r=(r&lt;&lt;8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo(&quot;string&quot;,this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e&gt;&gt;25&amp;127),(e&gt;&gt;21&amp;15)-1,e&gt;&gt;16&amp;31,e&gt;&gt;11&amp;31,e&gt;&gt;5&amp;63,(31&amp;e)&lt;&lt;1))}},t.exports=i},{&quot;..\/utils&quot;:32}],19:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;.\/Uint8ArrayReader&quot;);function i(e){n.call(this,e)}e(&quot;..\/utils&quot;).inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{&quot;..\/utils&quot;:32,&quot;.\/Uint8ArrayReader&quot;:21}],20:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;.\/DataReader&quot;);function i(e){n.call(this,e)}e(&quot;..\/utils&quot;).inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{&quot;..\/utils&quot;:32,&quot;.\/DataReader&quot;:18}],21:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;.\/ArrayReader&quot;);function i(e){n.call(this,e)}e(&quot;..\/utils&quot;).inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{&quot;..\/utils&quot;:32,&quot;.\/ArrayReader&quot;:17}],22:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;..\/utils&quot;),i=e(&quot;..\/support&quot;),s=e(&quot;.\/ArrayReader&quot;),a=e(&quot;.\/StringReader&quot;),o=e(&quot;.\/NodeBufferReader&quot;),h=e(&quot;.\/Uint8ArrayReader&quot;);t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),&quot;string&quot;!==t||i.uint8array?&quot;nodebuffer&quot;===t?new o(e):i.uint8array?new h(n.transformTo(&quot;uint8array&quot;,e)):new s(n.transformTo(&quot;array&quot;,e)):new a(e)}},{&quot;..\/support&quot;:30,&quot;..\/utils&quot;:32,&quot;.\/ArrayReader&quot;:17,&quot;.\/NodeBufferReader&quot;:19,&quot;.\/StringReader&quot;:20,&quot;.\/Uint8ArrayReader&quot;:21}],23:[function(e,t,r){&quot;use strict&quot;;r.LOCAL_FILE_HEADER=&quot;PK\u0003\u0004&quot;,r.CENTRAL_FILE_HEADER=&quot;PK\u0001\u0002&quot;,r.CENTRAL_DIRECTORY_END=&quot;PK\u0005\u0006&quot;,r.ZIP64_CENTRAL_DIRECTORY_LOCATOR=&quot;PK\u0006\u0007&quot;,r.ZIP64_CENTRAL_DIRECTORY_END=&quot;PK\u0006\u0006&quot;,r.DATA_DESCRIPTOR=&quot;PK\u0007\\b&quot;},{}],24:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;.\/GenericWorker&quot;),i=e(&quot;..\/utils&quot;);function s(e){n.call(this,&quot;ConvertWorker to &quot;+e),this.destType=e}i.inherits(s,n),s.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{&quot;..\/utils&quot;:32,&quot;.\/GenericWorker&quot;:28}],25:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;.\/GenericWorker&quot;),i=e(&quot;..\/crc32&quot;);function s(){n.call(this,&quot;Crc32Probe&quot;),this.withStreamInfo(&quot;crc32&quot;,0)}e(&quot;..\/utils&quot;).inherits(s,n),s.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{&quot;..\/crc32&quot;:4,&quot;..\/utils&quot;:32,&quot;.\/GenericWorker&quot;:28}],26:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;..\/utils&quot;),i=e(&quot;.\/GenericWorker&quot;);function s(e){i.call(this,&quot;DataLengthProbe for &quot;+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(s,i),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=s},{&quot;..\/utils&quot;:32,&quot;.\/GenericWorker&quot;:28}],27:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;..\/utils&quot;),i=e(&quot;.\/GenericWorker&quot;);function s(e){i.call(this,&quot;DataWorker&quot;);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=&quot;&quot;,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&amp;&amp;e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&amp;&amp;(!this._tickScheduled&amp;&amp;this.dataIsReady&amp;&amp;(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index&gt;=this.max)return this.end();switch(this.type){case&quot;string&quot;:e=this.data.substring(this.index,t);break;case&quot;uint8array&quot;:e=this.data.subarray(this.index,t);break;case&quot;array&quot;:case&quot;nodebuffer&quot;:e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index\/this.max*100:0}})},t.exports=s},{&quot;..\/utils&quot;:32,&quot;.\/GenericWorker&quot;:28}],28:[function(e,t,r){&quot;use strict&quot;;function n(e){this.name=e||&quot;default&quot;,this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit(&quot;data&quot;,e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(&quot;end&quot;),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(&quot;error&quot;,e)}return!0},error:function(e){return!this.isFinished&amp;&amp;(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(&quot;error&quot;,e),this.previous&amp;&amp;this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r&lt;this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error(&quot;The stream &#039;&quot;+this+&quot;&#039; has already been used.&quot;);this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on(&quot;data&quot;,function(e){t.processChunk(e)}),e.on(&quot;end&quot;,function(){t.end()}),e.on(&quot;error&quot;,function(e){t.error(e)}),this},pause:function(){return!this.isPaused&amp;&amp;!this.isFinished&amp;&amp;(this.isPaused=!0,this.previous&amp;&amp;this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&amp;&amp;(this.error(this.generatedError),e=!0),this.previous&amp;&amp;this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&amp;&amp;(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error(&quot;The stream &#039;&quot;+this+&quot;&#039; has already been used.&quot;);this.isLocked=!0,this.previous&amp;&amp;this.previous.lock()},toString:function(){var e=&quot;Worker &quot;+this.name;return this.previous?this.previous+&quot; -&gt; &quot;+e:e}},t.exports=n},{}],29:[function(e,t,r){&quot;use strict&quot;;var h=e(&quot;..\/utils&quot;),i=e(&quot;.\/ConvertWorker&quot;),s=e(&quot;.\/GenericWorker&quot;),u=e(&quot;..\/base64&quot;),n=e(&quot;..\/support&quot;),a=e(&quot;..\/external&quot;),o=null;if(n.nodestream)try{o=e(&quot;..\/nodejs\/NodejsStreamOutputAdapter&quot;)}catch(e){}function l(e,o){return new a.Promise(function(t,r){var n=[],i=e._internalType,s=e._outputType,a=e._mimeType;e.on(&quot;data&quot;,function(e,t){n.push(e),o&amp;&amp;o(t)}).on(&quot;error&quot;,function(e){n=[],r(e)}).on(&quot;end&quot;,function(){try{var e=function(e,t,r){switch(e){case&quot;blob&quot;:return h.newBlob(h.transformTo(&quot;arraybuffer&quot;,t),r);case&quot;base64&quot;:return u.encode(t);default:return h.transformTo(e,t)}}(s,function(e,t){var r,n=0,i=null,s=0;for(r=0;r&lt;t.length;r++)s+=t[r].length;switch(e){case&quot;string&quot;:return t.join(&quot;&quot;);case&quot;array&quot;:return Array.prototype.concat.apply([],t);case&quot;uint8array&quot;:for(i=new Uint8Array(s),r=0;r&lt;t.length;r++)i.set(t[r],n),n+=t[r].length;return i;case&quot;nodebuffer&quot;:return Buffer.concat(t);default:throw new Error(&quot;concat : unsupported type &#039;&quot;+e+&quot;&#039;&quot;)}}(i,n),a);t(e)}catch(e){r(e)}n=[]}).resume()})}function f(e,t,r){var n=t;switch(t){case&quot;blob&quot;:case&quot;arraybuffer&quot;:n=&quot;uint8array&quot;;break;case&quot;base64&quot;:n=&quot;string&quot;}try{this._internalType=n,this._outputType=t,this._mimeType=r,h.checkSupport(n),this._worker=e.pipe(new i(n)),e.lock()}catch(e){this._worker=new s(&quot;error&quot;),this._worker.error(e)}}f.prototype={accumulate:function(e){return l(this,e)},on:function(e,t){var r=this;return&quot;data&quot;===e?this._worker.on(e,function(e){t.call(r,e.data,e.meta)}):this._worker.on(e,function(){h.delay(t,arguments,r)}),this},resume:function(){return h.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(h.checkSupport(&quot;nodestream&quot;),&quot;nodebuffer&quot;!==this._outputType)throw new Error(this._outputType+&quot; is not supported by this method&quot;);return new o(this,{objectMode:&quot;nodebuffer&quot;!==this._outputType},e)}},t.exports=f},{&quot;..\/base64&quot;:1,&quot;..\/external&quot;:6,&quot;..\/nodejs\/NodejsStreamOutputAdapter&quot;:13,&quot;..\/support&quot;:30,&quot;..\/utils&quot;:32,&quot;.\/ConvertWorker&quot;:24,&quot;.\/GenericWorker&quot;:28}],30:[function(e,t,r){&quot;use strict&quot;;if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer=&quot;undefined&quot;!=typeof ArrayBuffer&amp;&amp;&quot;undefined&quot;!=typeof Uint8Array,r.nodebuffer=&quot;undefined&quot;!=typeof Buffer,r.uint8array=&quot;undefined&quot;!=typeof Uint8Array,&quot;undefined&quot;==typeof ArrayBuffer)r.blob=!1;else{var n=new ArrayBuffer(0);try{r.blob=0===new Blob([n],{type:&quot;application\/zip&quot;}).size}catch(e){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(n),r.blob=0===i.getBlob(&quot;application\/zip&quot;).size}catch(e){r.blob=!1}}}try{r.nodestream=!!e(&quot;readable-stream&quot;).Readable}catch(e){r.nodestream=!1}},{&quot;readable-stream&quot;:16}],31:[function(e,t,s){&quot;use strict&quot;;for(var o=e(&quot;.\/utils&quot;),h=e(&quot;.\/support&quot;),r=e(&quot;.\/nodejsUtils&quot;),n=e(&quot;.\/stream\/GenericWorker&quot;),u=new Array(256),i=0;i&lt;256;i++)u[i]=252&lt;=i?6:248&lt;=i?5:240&lt;=i?4:224&lt;=i?3:192&lt;=i?2:1;u[254]=u[254]=1;function a(){n.call(this,&quot;utf-8 decode&quot;),this.leftOver=null}function l(){n.call(this,&quot;utf-8 encode&quot;)}s.utf8encode=function(e){return h.nodebuffer?r.newBufferFrom(e,&quot;utf-8&quot;):function(e){var t,r,n,i,s,a=e.length,o=0;for(i=0;i&lt;a;i++)55296==(64512&amp;(r=e.charCodeAt(i)))&amp;&amp;i+1&lt;a&amp;&amp;56320==(64512&amp;(n=e.charCodeAt(i+1)))&amp;&amp;(r=65536+(r-55296&lt;&lt;10)+(n-56320),i++),o+=r&lt;128?1:r&lt;2048?2:r&lt;65536?3:4;for(t=h.uint8array?new Uint8Array(o):new Array(o),i=s=0;s&lt;o;i++)55296==(64512&amp;(r=e.charCodeAt(i)))&amp;&amp;i+1&lt;a&amp;&amp;56320==(64512&amp;(n=e.charCodeAt(i+1)))&amp;&amp;(r=65536+(r-55296&lt;&lt;10)+(n-56320),i++),r&lt;128?t[s++]=r:(r&lt;2048?t[s++]=192|r&gt;&gt;&gt;6:(r&lt;65536?t[s++]=224|r&gt;&gt;&gt;12:(t[s++]=240|r&gt;&gt;&gt;18,t[s++]=128|r&gt;&gt;&gt;12&amp;63),t[s++]=128|r&gt;&gt;&gt;6&amp;63),t[s++]=128|63&amp;r);return t}(e)},s.utf8decode=function(e){return h.nodebuffer?o.transformTo(&quot;nodebuffer&quot;,e).toString(&quot;utf-8&quot;):function(e){var t,r,n,i,s=e.length,a=new Array(2*s);for(t=r=0;t&lt;s;)if((n=e[t++])&lt;128)a[r++]=n;else if(4&lt;(i=u[n]))a[r++]=65533,t+=i-1;else{for(n&amp;=2===i?31:3===i?15:7;1&lt;i&amp;&amp;t&lt;s;)n=n&lt;&lt;6|63&amp;e[t++],i--;1&lt;i?a[r++]=65533:n&lt;65536?a[r++]=n:(n-=65536,a[r++]=55296|n&gt;&gt;10&amp;1023,a[r++]=56320|1023&amp;n)}return a.length!==r&amp;&amp;(a.subarray?a=a.subarray(0,r):a.length=r),o.applyFromCharCode(a)}(e=o.transformTo(h.uint8array?&quot;uint8array&quot;:&quot;array&quot;,e))},o.inherits(a,n),a.prototype.processChunk=function(e){var t=o.transformTo(h.uint8array?&quot;uint8array&quot;:&quot;array&quot;,e.data);if(this.leftOver&amp;&amp;this.leftOver.length){if(h.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var n=function(e,t){var r;for((t=t||e.length)&gt;e.length&amp;&amp;(t=e.length),r=t-1;0&lt;=r&amp;&amp;128==(192&amp;e[r]);)r--;return r&lt;0?t:0===r?t:r+u[e[r]]>t?r:t}(t),i=t;n!==t.length&amp;&amp;(h.uint8array?(i=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(i=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:s.utf8decode(i),meta:e.meta})},a.prototype.flush=function(){this.leftOver&amp;&amp;this.leftOver.length&amp;&amp;(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=a,o.inherits(l,n),l.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta})},s.Utf8EncodeWorker=l},{&quot;.\/nodejsUtils&quot;:14,&quot;.\/stream\/GenericWorker&quot;:28,&quot;.\/support&quot;:30,&quot;.\/utils&quot;:32}],32:[function(e,t,a){&quot;use strict&quot;;var o=e(&quot;.\/support&quot;),h=e(&quot;.\/base64&quot;),r=e(&quot;.\/nodejsUtils&quot;),u=e(&quot;.\/external&quot;);function n(e){return e}function l(e,t){for(var r=0;r&lt;e.length;++r)t[r]=255&amp;e.charCodeAt(r);return t}e(&quot;setimmediate&quot;),a.newBlob=function(t,r){a.checkSupport(&quot;blob&quot;);try{return new Blob([t],{type:r})}catch(e){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(t),n.getBlob(r)}catch(e){throw new Error(&quot;Bug : can&#039;t construct the Blob.&quot;)}}};var i={stringifyByChunk:function(e,t,r){var n=[],i=0,s=e.length;if(s&lt;=r)return String.fromCharCode.apply(null,e);for(;i&lt;s;)&quot;array&quot;===t||&quot;nodebuffer&quot;===t?n.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+r,s)))):n.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+r,s)))),i+=r;return n.join(&quot;&quot;)},stringifyByChar:function(e){for(var t=&quot;&quot;,r=0;r&lt;e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return o.uint8array&amp;&amp;1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return o.nodebuffer&amp;&amp;1===String.fromCharCode.apply(null,r.allocBuffer(1)).length}catch(e){return!1}}()}};function s(e){var t=65536,r=a.getTypeOf(e),n=!0;if(&quot;uint8array&quot;===r?n=i.applyCanBeUsed.uint8array:&quot;nodebuffer&quot;===r&amp;&amp;(n=i.applyCanBeUsed.nodebuffer),n)for(;1&lt;t;)try{return i.stringifyByChunk(e,r,t)}catch(e){t=Math.floor(t\/2)}return i.stringifyByChar(e)}function f(e,t){for(var r=0;r&lt;e.length;r++)t[r]=e[r];return t}a.applyFromCharCode=s;var c={};c.string={string:n,array:function(e){return l(e,new Array(e.length))},arraybuffer:function(e){return c.string.uint8array(e).buffer},uint8array:function(e){return l(e,new Uint8Array(e.length))},nodebuffer:function(e){return l(e,r.allocBuffer(e.length))}},c.array={string:s,array:n,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return r.newBufferFrom(e)}},c.arraybuffer={string:function(e){return s(new Uint8Array(e))},array:function(e){return f(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:n,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return r.newBufferFrom(new Uint8Array(e))}},c.uint8array={string:s,array:function(e){return f(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:n,nodebuffer:function(e){return r.newBufferFrom(e)}},c.nodebuffer={string:s,array:function(e){return f(e,new Array(e.length))},arraybuffer:function(e){return c.nodebuffer.uint8array(e).buffer},uint8array:function(e){return f(e,new Uint8Array(e.length))},nodebuffer:n},a.transformTo=function(e,t){if(t=t||&quot;&quot;,!e)return t;a.checkSupport(e);var r=a.getTypeOf(t);return c[r][e](t)},a.resolve=function(e){for(var t=e.split(&quot;\/&quot;),r=[],n=0;n&lt;t.length;n++){var i=t[n];&quot;.&quot;===i||&quot;&quot;===i&amp;&amp;0!==n&amp;&amp;n!==t.length-1||(&quot;..&quot;===i?r.pop():r.push(i))}return r.join(&quot;\/&quot;)},a.getTypeOf=function(e){return&quot;string&quot;==typeof e?&quot;string&quot;:&quot;[object Array]&quot;===Object.prototype.toString.call(e)?&quot;array&quot;:o.nodebuffer&amp;&amp;r.isBuffer(e)?&quot;nodebuffer&quot;:o.uint8array&amp;&amp;e instanceof Uint8Array?&quot;uint8array&quot;:o.arraybuffer&amp;&amp;e instanceof ArrayBuffer?&quot;arraybuffer&quot;:void 0},a.checkSupport=function(e){if(!o[e.toLowerCase()])throw new Error(e+&quot; is not supported by this platform&quot;)},a.MAX_VALUE_16BITS=65535,a.MAX_VALUE_32BITS=-1,a.pretty=function(e){var t,r,n=&quot;&quot;;for(r=0;r&lt;(e||&quot;&quot;).length;r++)n+=&quot;\\\\x&quot;+((t=e.charCodeAt(r))&lt;16?&quot;0&quot;:&quot;&quot;)+t.toString(16).toUpperCase();return n},a.delay=function(e,t,r){setImmediate(function(){e.apply(r||null,t||[])})},a.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r},a.extend=function(){var e,t,r={};for(e=0;e&lt;arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&amp;&amp;void 0===r[t]&amp;&amp;(r[t]=arguments[e][t]);return r},a.prepareContent=function(r,e,n,i,s){return u.Promise.resolve(e).then(function(n){return o.blob&amp;&amp;(n instanceof Blob||-1!==[&quot;[object File]&quot;,&quot;[object Blob]&quot;].indexOf(Object.prototype.toString.call(n)))&amp;&amp;&quot;undefined&quot;!=typeof FileReader?new u.Promise(function(t,r){var e=new FileReader;e.onload=function(e){t(e.target.result)},e.onerror=function(e){r(e.target.error)},e.readAsArrayBuffer(n)}):n}).then(function(e){var t=a.getTypeOf(e);return t?(&quot;arraybuffer&quot;===t?e=a.transformTo(&quot;uint8array&quot;,e):&quot;string&quot;===t&amp;&amp;(s?e=h.decode(e):n&amp;&amp;!0!==i&amp;&amp;(e=function(e){return l(e,o.uint8array?new Uint8Array(e.length):new Array(e.length))}(e))),e):u.Promise.reject(new Error(&quot;Can&#039;t read the data of &#039;&quot;+r+&quot;&#039;. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?&quot;))})}},{&quot;.\/base64&quot;:1,&quot;.\/external&quot;:6,&quot;.\/nodejsUtils&quot;:14,&quot;.\/support&quot;:30,setimmediate:54}],33:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;.\/reader\/readerFor&quot;),i=e(&quot;.\/utils&quot;),s=e(&quot;.\/signature&quot;),a=e(&quot;.\/zipEntry&quot;),o=e(&quot;.\/support&quot;);function h(e){this.files=[],this.loadOptions=e}h.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error(&quot;Corrupted zip or bug: unexpected signature (&quot;+i.pretty(t)+&quot;, expected &quot;+i.pretty(e)+&quot;)&quot;)}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4)===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=o.uint8array?&quot;uint8array&quot;:&quot;array&quot;,r=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;0&lt;n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1&lt;this.disksCount)throw new Error(&quot;Multi-volumes zip are not supported&quot;)},readLocalFiles:function(){var e,t;for(e=0;e&lt;this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(e=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&amp;&amp;0!==this.centralDirRecords&amp;&amp;0===this.files.length)throw new Error(&quot;Corrupted zip or bug: expected &quot;+this.centralDirRecords+&quot; records in central dir, got &quot;+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(e&lt;0)throw!this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error(&quot;Can&#039;t find end of central directory : is this a zip file ? If it is, see https:\/\/stuk.github.io\/jszip\/documentation\/howto\/read_zip.html&quot;):new Error(&quot;Corrupted zip: can&#039;t find end of central directory&quot;);this.reader.setIndex(e);var t=e;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))&lt;0)throw new Error(&quot;Corrupted zip: can&#039;t find the ZIP64 end of central directory locator&quot;);if(this.reader.setIndex(e),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&amp;&amp;(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir&lt;0))throw new Error(&quot;Corrupted zip: can&#039;t find the ZIP64 end of central directory&quot;);this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&amp;&amp;(r+=20,r+=12+this.zip64EndOfCentralSize);var n=t-r;if(0&lt;n)this.isSignature(t,s.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n&lt;0)throw new Error(&quot;Corrupted zip: missing &quot;+Math.abs(n)+&quot; bytes.&quot;)},prepareReader:function(e){this.reader=n(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=h},{&quot;.\/reader\/readerFor&quot;:22,&quot;.\/signature&quot;:23,&quot;.\/support&quot;:30,&quot;.\/utils&quot;:32,&quot;.\/zipEntry&quot;:34}],34:[function(e,t,r){&quot;use strict&quot;;var n=e(&quot;.\/reader\/readerFor&quot;),s=e(&quot;.\/utils&quot;),i=e(&quot;.\/compressedObject&quot;),a=e(&quot;.\/crc32&quot;),o=e(&quot;.\/utf8&quot;),h=e(&quot;.\/compressions&quot;),u=e(&quot;.\/support&quot;);function l(e,t){this.options=e,this.loadOptions=t}l.prototype={isEncrypted:function(){return 1==(1&amp;this.bitFlag)},useUTF8:function(){return 2048==(2048&amp;this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error(&quot;Bug or corrupted zip : didn&#039;t get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)&quot;);if(null===(t=function(e){for(var t in h)if(Object.prototype.hasOwnProperty.call(h,t)&amp;&amp;h[t].magic===e)return h[t];return null}(this.compressionMethod)))throw new Error(&quot;Corrupted zip : compression &quot;+s.pretty(this.compressionMethod)+&quot; unknown (inner file : &quot;+s.transformTo(&quot;string&quot;,this.fileName)+&quot;)&quot;);this.decompressed=new i(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error(&quot;Encrypted zip are not supported&quot;);e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy&gt;&gt;8;this.dir=!!(16&amp;this.externalFileAttributes),0==e&amp;&amp;(this.dosPermissions=63&amp;this.externalFileAttributes),3==e&amp;&amp;(this.unixPermissions=this.externalFileAttributes&gt;&gt;16&amp;65535),this.dir||&quot;\/&quot;!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&amp;&amp;(this.uncompressedSize=e.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&amp;&amp;(this.compressedSize=e.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&amp;&amp;(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&amp;&amp;(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4&lt;i;)t=e.readInt(2),r=e.readInt(2),n=e.readData(r),this.extraFields[t]={id:t,length:r,value:n};e.setIndex(i)},handleUTF8:function(){var e=u.uint8array?&quot;uint8array&quot;:&quot;array&quot;;if(this.useUTF8())this.fileNameStr=o.utf8decode(this.fileName),this.fileCommentStr=o.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=s.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var i=s.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(i)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=n(e.value);return 1!==t.readInt(1)?null:a(this.fileName)!==t.readInt(4)?null:o.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=n(e.value);return 1!==t.readInt(1)?null:a(this.fileComment)!==t.readInt(4)?null:o.utf8decode(t.readData(e.length-5))}return null}},t.exports=l},{&quot;.\/compressedObject&quot;:2,&quot;.\/compressions&quot;:3,&quot;.\/crc32&quot;:4,&quot;.\/reader\/readerFor&quot;:22,&quot;.\/support&quot;:30,&quot;.\/utf8&quot;:31,&quot;.\/utils&quot;:32}],35:[function(e,t,r){&quot;use strict&quot;;function n(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}}var s=e(&quot;.\/stream\/StreamHelper&quot;),i=e(&quot;.\/stream\/DataWorker&quot;),a=e(&quot;.\/utf8&quot;),o=e(&quot;.\/compressedObject&quot;),h=e(&quot;.\/stream\/GenericWorker&quot;);n.prototype={internalStream:function(e){var t=null,r=&quot;string&quot;;try{if(!e)throw new Error(&quot;No output type specified.&quot;);var n=&quot;string&quot;===(r=e.toLowerCase())||&quot;text&quot;===r;&quot;binarystring&quot;!==r&amp;&amp;&quot;text&quot;!==r||(r=&quot;string&quot;),t=this._decompressWorker();var i=!this._dataBinary;i&amp;&amp;!n&amp;&amp;(t=t.pipe(new a.Utf8EncodeWorker)),!i&amp;&amp;n&amp;&amp;(t=t.pipe(new a.Utf8DecodeWorker))}catch(e){(t=new h(&quot;error&quot;)).error(e)}return new s(t,r,&quot;&quot;)},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||&quot;nodebuffer&quot;).toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof o&amp;&amp;this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new a.Utf8EncodeWorker)),o.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof h?this._data:new i(this._data)}};for(var u=[&quot;asText&quot;,&quot;asBinary&quot;,&quot;asNodeBuffer&quot;,&quot;asUint8Array&quot;,&quot;asArrayBuffer&quot;],l=function(){throw new Error(&quot;This method has been removed in JSZip 3.0, please check the upgrade guide.&quot;)},f=0;f&lt;u.length;f++)n.prototype[u[f]]=l;t.exports=n},{&quot;.\/compressedObject&quot;:2,&quot;.\/stream\/DataWorker&quot;:27,&quot;.\/stream\/GenericWorker&quot;:28,&quot;.\/stream\/StreamHelper&quot;:29,&quot;.\/utf8&quot;:31}],36:[function(e,l,t){(function(t){&quot;use strict&quot;;var r,n,e=t.MutationObserver||t.WebKitMutationObserver;if(e){var i=0,s=new e(u),a=t.document.createTextNode(&quot;&quot;);s.observe(a,{characterData:!0}),r=function(){a.data=i=++i%2}}else if(t.setImmediate||void 0===t.MessageChannel)r=&quot;document&quot;in t&amp;&amp;&quot;onreadystatechange&quot;in t.document.createElement(&quot;script&quot;)?function(){var e=t.document.createElement(&quot;script&quot;);e.onreadystatechange=function(){u(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(u,0)};else{var o=new t.MessageChannel;o.port1.onmessage=u,r=function(){o.port2.postMessage(0)}}var h=[];function u(){var e,t;n=!0;for(var r=h.length;r;){for(t=h,h=[],e=-1;++e&lt;r;)t[e]();r=h.length}n=!1}l.exports=function(e){1!==h.push(e)||n||r()}}).call(this,&quot;undefined&quot;!=typeof global?global:&quot;undefined&quot;!=typeof self?self:&quot;undefined&quot;!=typeof window?window:{})},{}],37:[function(e,t,r){&quot;use strict&quot;;var i=e(&quot;immediate&quot;);function u(){}var l={},s=[&quot;REJECTED&quot;],a=[&quot;FULFILLED&quot;],n=[&quot;PENDING&quot;];function o(e){if(&quot;function&quot;!=typeof e)throw new TypeError(&quot;resolver must be a function&quot;);this.state=n,this.queue=[],this.outcome=void 0,e!==u&amp;&amp;d(this,e)}function h(e,t,r){this.promise=e,&quot;function&quot;==typeof t&amp;&amp;(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),&quot;function&quot;==typeof r&amp;&amp;(this.onRejected=r,this.callRejected=this.otherCallRejected)}function f(t,r,n){i(function(){var e;try{e=r(n)}catch(e){return l.reject(t,e)}e===t?l.reject(t,new TypeError(&quot;Cannot resolve promise with itself&quot;)):l.resolve(t,e)})}function c(e){var t=e&amp;&amp;e.then;if(e&amp;&amp;(&quot;object&quot;==typeof e||&quot;function&quot;==typeof e)&amp;&amp;&quot;function&quot;==typeof t)return function(){t.apply(e,arguments)}}function d(t,e){var r=!1;function n(e){r||(r=!0,l.reject(t,e))}function i(e){r||(r=!0,l.resolve(t,e))}var s=p(function(){e(i,n)});&quot;error&quot;===s.status&amp;&amp;n(s.value)}function p(e,t){var r={};try{r.value=e(t),r.status=&quot;success&quot;}catch(e){r.status=&quot;error&quot;,r.value=e}return r}(t.exports=o).prototype.finally=function(t){if(&quot;function&quot;!=typeof t)return this;var r=this.constructor;return this.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e})})},o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){if(&quot;function&quot;!=typeof e&amp;&amp;this.state===a||&quot;function&quot;!=typeof t&amp;&amp;this.state===s)return this;var r=new this.constructor(u);this.state!==n?f(r,this.state===a?e:t,this.outcome):this.queue.push(new h(r,e,t));return r},h.prototype.callFulfilled=function(e){l.resolve(this.promise,e)},h.prototype.otherCallFulfilled=function(e){f(this.promise,this.onFulfilled,e)},h.prototype.callRejected=function(e){l.reject(this.promise,e)},h.prototype.otherCallRejected=function(e){f(this.promise,this.onRejected,e)},l.resolve=function(e,t){var r=p(c,t);if(&quot;error&quot;===r.status)return l.reject(e,r.value);var n=r.value;if(n)d(e,n);else{e.state=a,e.outcome=t;for(var i=-1,s=e.queue.length;++i&lt;s;)e.queue[i].callFulfilled(t)}return e},l.reject=function(e,t){e.state=s,e.outcome=t;for(var r=-1,n=e.queue.length;++r&lt;n;)e.queue[r].callRejected(t);return e},o.resolve=function(e){if(e instanceof this)return e;return l.resolve(new this(u),e)},o.reject=function(e){var t=new this(u);return l.reject(t,e)},o.all=function(e){var r=this;if(&quot;[object Array]&quot;!==Object.prototype.toString.call(e))return this.reject(new TypeError(&quot;must be an array&quot;));var n=e.length,i=!1;if(!n)return this.resolve([]);var s=new Array(n),a=0,t=-1,o=new this(u);for(;++t&lt;n;)h(e[t],t);return o;function h(e,t){r.resolve(e).then(function(e){s[t]=e,++a!==n||i||(i=!0,l.resolve(o,s))},function(e){i||(i=!0,l.reject(o,e))})}},o.race=function(e){var t=this;if(&quot;[object Array]&quot;!==Object.prototype.toString.call(e))return this.reject(new TypeError(&quot;must be an array&quot;));var r=e.length,n=!1;if(!r)return this.resolve([]);var i=-1,s=new this(u);for(;++i&lt;r;)a=e[i],t.resolve(a).then(function(e){n||(n=!0,l.resolve(s,e))},function(e){n||(n=!0,l.reject(s,e))});var a;return s}},{immediate:36}],38:[function(e,t,r){&quot;use strict&quot;;var n={};(0,e(&quot;.\/lib\/utils\/common&quot;).assign)(n,e(&quot;.\/lib\/deflate&quot;),e(&quot;.\/lib\/inflate&quot;),e(&quot;.\/lib\/zlib\/constants&quot;)),t.exports=n},{&quot;.\/lib\/deflate&quot;:39,&quot;.\/lib\/inflate&quot;:40,&quot;.\/lib\/utils\/common&quot;:41,&quot;.\/lib\/zlib\/constants&quot;:44}],39:[function(e,t,r){&quot;use strict&quot;;var a=e(&quot;.\/zlib\/deflate&quot;),o=e(&quot;.\/utils\/common&quot;),h=e(&quot;.\/utils\/strings&quot;),i=e(&quot;.\/zlib\/messages&quot;),s=e(&quot;.\/zlib\/zstream&quot;),u=Object.prototype.toString,l=0,f=-1,c=0,d=8;function p(e){if(!(this instanceof p))return new p(e);this.options=o.assign({level:f,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:c,to:&quot;&quot;},e||{});var t=this.options;t.raw&amp;&amp;0&lt;t.windowBits?t.windowBits=-t.windowBits:t.gzip&amp;&amp;0&lt;t.windowBits&amp;&amp;t.windowBits&lt;16&amp;&amp;(t.windowBits+=16),this.err=0,this.msg=&quot;&quot;,this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==l)throw new Error(i[r]);if(t.header&amp;&amp;a.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(n=&quot;string&quot;==typeof t.dictionary?h.string2buf(t.dictionary):&quot;[object ArrayBuffer]&quot;===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=a.deflateSetDictionary(this.strm,n))!==l)throw new Error(i[r]);this._dict_set=!0}}function n(e,t){var r=new p(t);if(r.push(e,!0),r.err)throw r.msg||i[r.err];return r.result}p.prototype.push=function(e,t){var r,n,i=this.strm,s=this.options.chunkSize;if(this.ended)return!1;n=t===~~t?t:!0===t?4:0,&quot;string&quot;==typeof e?i.input=h.string2buf(e):&quot;[object ArrayBuffer]&quot;===u.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&amp;&amp;(i.output=new o.Buf8(s),i.next_out=0,i.avail_out=s),1!==(r=a.deflate(i,n))&amp;&amp;r!==l)return this.onEnd(r),!(this.ended=!0);0!==i.avail_out&amp;&amp;(0!==i.avail_in||4!==n&amp;&amp;2!==n)||(&quot;string&quot;===this.options.to?this.onData(h.buf2binstring(o.shrinkBuf(i.output,i.next_out))):this.onData(o.shrinkBuf(i.output,i.next_out)))}while((0&lt;i.avail_in||0===i.avail_out)&amp;&amp;1!==r);return 4===n?(r=a.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===l):2!==n||(this.onEnd(l),!(i.avail_out=0))},p.prototype.onData=function(e){this.chunks.push(e)},p.prototype.onEnd=function(e){e===l&amp;&amp;(&quot;string&quot;===this.options.to?this.result=this.chunks.join(&quot;&quot;):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Deflate=p,r.deflate=n,r.deflateRaw=function(e,t){return(t=t||{}).raw=!0,n(e,t)},r.gzip=function(e,t){return(t=t||{}).gzip=!0,n(e,t)}},{&quot;.\/utils\/common&quot;:41,&quot;.\/utils\/strings&quot;:42,&quot;.\/zlib\/deflate&quot;:46,&quot;.\/zlib\/messages&quot;:51,&quot;.\/zlib\/zstream&quot;:53}],40:[function(e,t,r){&quot;use strict&quot;;var c=e(&quot;.\/zlib\/inflate&quot;),d=e(&quot;.\/utils\/common&quot;),p=e(&quot;.\/utils\/strings&quot;),m=e(&quot;.\/zlib\/constants&quot;),n=e(&quot;.\/zlib\/messages&quot;),i=e(&quot;.\/zlib\/zstream&quot;),s=e(&quot;.\/zlib\/gzheader&quot;),_=Object.prototype.toString;function a(e){if(!(this instanceof a))return new a(e);this.options=d.assign({chunkSize:16384,windowBits:0,to:&quot;&quot;},e||{});var t=this.options;t.raw&amp;&amp;0&lt;=t.windowBits&amp;&amp;t.windowBits&lt;16&amp;&amp;(t.windowBits=-t.windowBits,0===t.windowBits&amp;&amp;(t.windowBits=-15)),!(0&lt;=t.windowBits&amp;&amp;t.windowBits&lt;16)||e&amp;&amp;e.windowBits||(t.windowBits+=32),15&lt;t.windowBits&amp;&amp;t.windowBits&lt;48&amp;&amp;0==(15&amp;t.windowBits)&amp;&amp;(t.windowBits|=15),this.err=0,this.msg=&quot;&quot;,this.ended=!1,this.chunks=[],this.strm=new i,this.strm.avail_out=0;var r=c.inflateInit2(this.strm,t.windowBits);if(r!==m.Z_OK)throw new Error(n[r]);this.header=new s,c.inflateGetHeader(this.strm,this.header)}function o(e,t){var r=new a(t);if(r.push(e,!0),r.err)throw r.msg||n[r.err];return r.result}a.prototype.push=function(e,t){var r,n,i,s,a,o,h=this.strm,u=this.options.chunkSize,l=this.options.dictionary,f=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?m.Z_FINISH:m.Z_NO_FLUSH,&quot;string&quot;==typeof e?h.input=p.binstring2buf(e):&quot;[object ArrayBuffer]&quot;===_.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&amp;&amp;(h.output=new d.Buf8(u),h.next_out=0,h.avail_out=u),(r=c.inflate(h,m.Z_NO_FLUSH))===m.Z_NEED_DICT&amp;&amp;l&amp;&amp;(o=&quot;string&quot;==typeof l?p.string2buf(l):&quot;[object ArrayBuffer]&quot;===_.call(l)?new Uint8Array(l):l,r=c.inflateSetDictionary(this.strm,o)),r===m.Z_BUF_ERROR&amp;&amp;!0===f&amp;&amp;(r=m.Z_OK,f=!1),r!==m.Z_STREAM_END&amp;&amp;r!==m.Z_OK)return this.onEnd(r),!(this.ended=!0);h.next_out&amp;&amp;(0!==h.avail_out&amp;&amp;r!==m.Z_STREAM_END&amp;&amp;(0!==h.avail_in||n!==m.Z_FINISH&amp;&amp;n!==m.Z_SYNC_FLUSH)||(&quot;string&quot;===this.options.to?(i=p.utf8border(h.output,h.next_out),s=h.next_out-i,a=p.buf2string(h.output,i),h.next_out=s,h.avail_out=u-s,s&amp;&amp;d.arraySet(h.output,h.output,i,s,0),this.onData(a)):this.onData(d.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&amp;&amp;0===h.avail_out&amp;&amp;(f=!0)}while((0&lt;h.avail_in||0===h.avail_out)&amp;&amp;r!==m.Z_STREAM_END);return r===m.Z_STREAM_END&amp;&amp;(n=m.Z_FINISH),n===m.Z_FINISH?(r=c.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===m.Z_OK):n!==m.Z_SYNC_FLUSH||(this.onEnd(m.Z_OK),!(h.avail_out=0))},a.prototype.onData=function(e){this.chunks.push(e)},a.prototype.onEnd=function(e){e===m.Z_OK&amp;&amp;(&quot;string&quot;===this.options.to?this.result=this.chunks.join(&quot;&quot;):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=a,r.inflate=o,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,o(e,t)},r.ungzip=o},{&quot;.\/utils\/common&quot;:41,&quot;.\/utils\/strings&quot;:42,&quot;.\/zlib\/constants&quot;:44,&quot;.\/zlib\/gzheader&quot;:47,&quot;.\/zlib\/inflate&quot;:49,&quot;.\/zlib\/messages&quot;:51,&quot;.\/zlib\/zstream&quot;:53}],41:[function(e,t,r){&quot;use strict&quot;;var n=&quot;undefined&quot;!=typeof Uint8Array&amp;&amp;&quot;undefined&quot;!=typeof Uint16Array&amp;&amp;&quot;undefined&quot;!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(&quot;object&quot;!=typeof r)throw new TypeError(r+&quot;must be non-object&quot;);for(var n in r)r.hasOwnProperty(n)&amp;&amp;(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&amp;&amp;e.subarray)e.set(t.subarray(r,r+n),i);else for(var s=0;s&lt;n;s++)e[i+s]=t[r+s]},flattenChunks:function(e){var t,r,n,i,s,a;for(t=n=0,r=e.length;t&lt;r;t++)n+=e[t].length;for(a=new Uint8Array(n),t=i=0,r=e.length;t&lt;r;t++)s=e[t],a.set(s,i),i+=s.length;return a}},s={arraySet:function(e,t,r,n,i){for(var s=0;s&lt;n;s++)e[i+s]=t[r+s]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,s))},r.setTyped(n)},{}],42:[function(e,t,r){&quot;use strict&quot;;var h=e(&quot;.\/common&quot;),i=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){s=!1}for(var u=new h.Buf8(256),n=0;n&lt;256;n++)u[n]=252&lt;=n?6:248&lt;=n?5:240&lt;=n?4:224&lt;=n?3:192&lt;=n?2:1;function l(e,t){if(t&lt;65537&amp;&amp;(e.subarray&amp;&amp;s||!e.subarray&amp;&amp;i))return String.fromCharCode.apply(null,h.shrinkBuf(e,t));for(var r=&quot;&quot;,n=0;n&lt;t;n++)r+=String.fromCharCode(e[n]);return r}u[254]=u[254]=1,r.string2buf=function(e){var t,r,n,i,s,a=e.length,o=0;for(i=0;i&lt;a;i++)55296==(64512&amp;(r=e.charCodeAt(i)))&amp;&amp;i+1&lt;a&amp;&amp;56320==(64512&amp;(n=e.charCodeAt(i+1)))&amp;&amp;(r=65536+(r-55296&lt;&lt;10)+(n-56320),i++),o+=r&lt;128?1:r&lt;2048?2:r&lt;65536?3:4;for(t=new h.Buf8(o),i=s=0;s&lt;o;i++)55296==(64512&amp;(r=e.charCodeAt(i)))&amp;&amp;i+1&lt;a&amp;&amp;56320==(64512&amp;(n=e.charCodeAt(i+1)))&amp;&amp;(r=65536+(r-55296&lt;&lt;10)+(n-56320),i++),r&lt;128?t[s++]=r:(r&lt;2048?t[s++]=192|r&gt;&gt;&gt;6:(r&lt;65536?t[s++]=224|r&gt;&gt;&gt;12:(t[s++]=240|r&gt;&gt;&gt;18,t[s++]=128|r&gt;&gt;&gt;12&amp;63),t[s++]=128|r&gt;&gt;&gt;6&amp;63),t[s++]=128|63&amp;r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new h.Buf8(e.length),r=0,n=t.length;r&lt;n;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,i,s,a=t||e.length,o=new Array(2*a);for(r=n=0;r&lt;a;)if((i=e[r++])&lt;128)o[n++]=i;else if(4&lt;(s=u[i]))o[n++]=65533,r+=s-1;else{for(i&amp;=2===s?31:3===s?15:7;1&lt;s&amp;&amp;r&lt;a;)i=i&lt;&lt;6|63&amp;e[r++],s--;1&lt;s?o[n++]=65533:i&lt;65536?o[n++]=i:(i-=65536,o[n++]=55296|i&gt;&gt;10&amp;1023,o[n++]=56320|1023&amp;i)}return l(o,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)&gt;e.length&amp;&amp;(t=e.length),r=t-1;0&lt;=r&amp;&amp;128==(192&amp;e[r]);)r--;return r&lt;0?t:0===r?t:r+u[e[r]]>t?r:t}},{&quot;.\/common&quot;:41}],43:[function(e,t,r){&quot;use strict&quot;;t.exports=function(e,t,r,n){for(var i=65535&amp;e|0,s=e&gt;&gt;&gt;16&amp;65535|0,a=0;0!==r;){for(r-=a=2e3&lt;r?2e3:r;s=s+(i=i+t[n++]|0)|0,--a;);i%=65521,s%=65521}return i|s&lt;&lt;16|0}},{}],44:[function(e,t,r){&quot;use strict&quot;;t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,r){&quot;use strict&quot;;var o=function(){for(var e,t=[],r=0;r&lt;256;r++){e=r;for(var n=0;n&lt;8;n++)e=1&amp;e?3988292384^e&gt;&gt;&gt;1:e&gt;&gt;&gt;1;t[r]=e}return t}();t.exports=function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a&lt;s;a++)e=e&gt;&gt;&gt;8^i[255&amp;(e^t[a])];return-1^e}},{}],46:[function(e,t,r){&quot;use strict&quot;;var h,c=e(&quot;..\/utils\/common&quot;),u=e(&quot;.\/trees&quot;),d=e(&quot;.\/adler32&quot;),p=e(&quot;.\/crc32&quot;),n=e(&quot;.\/messages&quot;),l=0,f=4,m=0,_=-2,g=-1,b=4,i=2,v=8,y=9,s=286,a=30,o=19,w=2*s+1,k=15,x=3,S=258,z=S+x+1,C=42,E=113,A=1,I=2,O=3,B=4;function R(e,t){return e.msg=n[t],t}function T(e){return(e&lt;&lt;1)-(4&lt;e?9:0)}function D(e){for(var t=e.length;0&lt;=--t;)e[t]=0}function F(e){var t=e.state,r=t.pending;r&gt;e.avail_out&amp;&amp;(r=e.avail_out),0!==r&amp;&amp;(c.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&amp;&amp;(t.pending_out=0))}function N(e,t){u._tr_flush_block(e,0&lt;=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm)}function U(e,t){e.pending_buf[e.pending++]=t}function P(e,t){e.pending_buf[e.pending++]=t&gt;&gt;&gt;8&amp;255,e.pending_buf[e.pending++]=255&amp;t}function L(e,t){var r,n,i=e.max_chain_length,s=e.strstart,a=e.prev_length,o=e.nice_match,h=e.strstart&gt;e.w_size-z?e.strstart-(e.w_size-z):0,u=e.window,l=e.w_mask,f=e.prev,c=e.strstart+S,d=u[s+a-1],p=u[s+a];e.prev_length&gt;=e.good_match&amp;&amp;(i&gt;&gt;=2),o&gt;e.lookahead&amp;&amp;(o=e.lookahead);do{if(u[(r=t)+a]===p&amp;&amp;u[r+a-1]===d&amp;&amp;u[r]===u[s]&amp;&amp;u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&amp;&amp;u[++s]===u[++r]&amp;&amp;u[++s]===u[++r]&amp;&amp;u[++s]===u[++r]&amp;&amp;u[++s]===u[++r]&amp;&amp;u[++s]===u[++r]&amp;&amp;u[++s]===u[++r]&amp;&amp;u[++s]===u[++r]&amp;&amp;s&lt;c);if(n=S-(c-s),s=c-S,a&lt;n){if(e.match_start=t,o&lt;=(a=n))break;d=u[s+a-1],p=u[s+a]}}}while((t=f[t&amp;l])&gt;h&amp;&amp;0!=--i);return a&lt;=e.lookahead?a:e.lookahead}function j(e){var t,r,n,i,s,a,o,h,u,l,f=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart&gt;=f+(f-z)){for(c.arraySet(e.window,e.window,f,f,0),e.match_start-=f,e.strstart-=f,e.block_start-=f,t=r=e.hash_size;n=e.head[--t],e.head[t]=f&lt;=n?n-f:0,--r;);for(t=r=f;n=e.prev[--t],e.prev[t]=f&lt;=n?n-f:0,--r;);i+=f}if(0===e.strm.avail_in)break;if(a=e.strm,o=e.window,h=e.strstart+e.lookahead,u=i,l=void 0,l=a.avail_in,u&lt;l&amp;&amp;(l=u),r=0===l?0:(a.avail_in-=l,c.arraySet(o,a.input,a.next_in,l,h),1===a.state.wrap?a.adler=d(a.adler,o,l,h):2===a.state.wrap&amp;&amp;(a.adler=p(a.adler,o,l,h)),a.next_in+=l,a.total_in+=l,l),e.lookahead+=r,e.lookahead+e.insert&gt;=x)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h&lt;&lt;e.hash_shift^e.window[s+1])&amp;e.hash_mask;e.insert&amp;&amp;(e.ins_h=(e.ins_h&lt;&lt;e.hash_shift^e.window[s+x-1])&amp;e.hash_mask,e.prev[s&amp;e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert&lt;x)););}while(e.lookahead&lt;z&amp;&amp;0!==e.strm.avail_in)}function Z(e,t){for(var r,n;;){if(e.lookahead&lt;z){if(j(e),e.lookahead&lt;z&amp;&amp;t===l)return A;if(0===e.lookahead)break}if(r=0,e.lookahead&gt;=x&amp;&amp;(e.ins_h=(e.ins_h&lt;&lt;e.hash_shift^e.window[e.strstart+x-1])&amp;e.hash_mask,r=e.prev[e.strstart&amp;e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&amp;&amp;e.strstart-r&lt;=e.w_size-z&amp;&amp;(e.match_length=L(e,r)),e.match_length&gt;=x)if(n=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length&lt;=e.max_lazy_match&amp;&amp;e.lookahead&gt;=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h&lt;&lt;e.hash_shift^e.window[e.strstart+x-1])&amp;e.hash_mask,r=e.prev[e.strstart&amp;e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h&lt;&lt;e.hash_shift^e.window[e.strstart+1])&amp;e.hash_mask;else n=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&amp;&amp;(N(e,!1),0===e.strm.avail_out))return A}return e.insert=e.strstart&lt;x-1?e.strstart:x-1,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&amp;&amp;(N(e,!1),0===e.strm.avail_out)?A:I}function W(e,t){for(var r,n,i;;){if(e.lookahead&lt;z){if(j(e),e.lookahead&lt;z&amp;&amp;t===l)return A;if(0===e.lookahead)break}if(r=0,e.lookahead&gt;=x&amp;&amp;(e.ins_h=(e.ins_h&lt;&lt;e.hash_shift^e.window[e.strstart+x-1])&amp;e.hash_mask,r=e.prev[e.strstart&amp;e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=x-1,0!==r&amp;&amp;e.prev_length&lt;e.max_lazy_match&amp;&amp;e.strstart-r&lt;=e.w_size-z&amp;&amp;(e.match_length=L(e,r),e.match_length&lt;=5&amp;&amp;(1===e.strategy||e.match_length===x&amp;&amp;4096&lt;e.strstart-e.match_start)&amp;&amp;(e.match_length=x-1)),e.prev_length&gt;=x&amp;&amp;e.match_length&lt;=e.prev_length){for(i=e.strstart+e.lookahead-x,n=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart&lt;=i&amp;&amp;(e.ins_h=(e.ins_h&lt;&lt;e.hash_shift^e.window[e.strstart+x-1])&amp;e.hash_mask,r=e.prev[e.strstart&amp;e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=x-1,e.strstart++,n&amp;&amp;(N(e,!1),0===e.strm.avail_out))return A}else if(e.match_available){if((n=u._tr_tally(e,0,e.window[e.strstart-1]))&amp;&amp;N(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return A}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&amp;&amp;(n=u._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart&lt;x-1?e.strstart:x-1,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&amp;&amp;(N(e,!1),0===e.strm.avail_out)?A:I}function M(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function H(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new c.Buf16(2*w),this.dyn_dtree=new c.Buf16(2*(2*a+1)),this.bl_tree=new c.Buf16(2*(2*o+1)),D(this.dyn_ltree),D(this.dyn_dtree),D(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new c.Buf16(k+1),this.heap=new c.Buf16(2*s+1),D(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new c.Buf16(2*s+1),D(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function G(e){var t;return e&amp;&amp;e.state?(e.total_in=e.total_out=0,e.data_type=i,(t=e.state).pending=0,t.pending_out=0,t.wrap&lt;0&amp;&amp;(t.wrap=-t.wrap),t.status=t.wrap?C:E,e.adler=2===t.wrap?0:1,t.last_flush=l,u._tr_init(t),m):R(e,_)}function K(e){var t=G(e);return t===m&amp;&amp;function(e){e.window_size=2*e.w_size,D(e.head),e.max_lazy_match=h[e.level].max_lazy,e.good_match=h[e.level].good_length,e.nice_match=h[e.level].nice_length,e.max_chain_length=h[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=x-1,e.match_available=0,e.ins_h=0}(e.state),t}function Y(e,t,r,n,i,s){if(!e)return _;var a=1;if(t===g&amp;&amp;(t=6),n&lt;0?(a=0,n=-n):15&lt;n&amp;&amp;(a=2,n-=16),i&lt;1||y&lt;i||r!==v||n&lt;8||15&lt;n||t&lt;0||9&lt;t||s&lt;0||b&lt;s)return R(e,_);8===n&amp;&amp;(n=9);var o=new H;return(e.state=o).strm=e,o.wrap=a,o.gzhead=null,o.w_bits=n,o.w_size=1&lt;&lt;o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1&lt;&lt;o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+x-1)\/x),o.window=new c.Buf8(2*o.w_size),o.head=new c.Buf16(o.hash_size),o.prev=new c.Buf16(o.w_size),o.lit_bufsize=1&lt;&lt;i+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new c.Buf8(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=s,o.method=r,K(e)}h=[new M(0,0,0,0,function(e,t){var r=65535;for(r&gt;e.pending_buf_size-5&amp;&amp;(r=e.pending_buf_size-5);;){if(e.lookahead&lt;=1){if(j(e),0===e.lookahead&amp;&amp;t===l)return A;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart&gt;=n)&amp;&amp;(e.lookahead=e.strstart-n,e.strstart=n,N(e,!1),0===e.strm.avail_out))return A;if(e.strstart-e.block_start&gt;=e.w_size-z&amp;&amp;(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):(e.strstart&gt;e.block_start&amp;&amp;(N(e,!1),e.strm.avail_out),A)}),new M(4,4,8,4,Z),new M(4,5,16,8,Z),new M(4,6,32,32,Z),new M(4,4,16,16,W),new M(8,16,32,32,W),new M(8,16,128,128,W),new M(8,32,128,256,W),new M(32,128,258,1024,W),new M(32,258,258,4096,W)],r.deflateInit=function(e,t){return Y(e,t,v,15,8,0)},r.deflateInit2=Y,r.deflateReset=K,r.deflateResetKeep=G,r.deflateSetHeader=function(e,t){return e&amp;&amp;e.state?2!==e.state.wrap?_:(e.state.gzhead=t,m):_},r.deflate=function(e,t){var r,n,i,s;if(!e||!e.state||5&lt;t||t&lt;0)return e?R(e,_):_;if(n=e.state,!e.output||!e.input&amp;&amp;0!==e.avail_in||666===n.status&amp;&amp;t!==f)return R(e,0===e.avail_out?-5:_);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===C)if(2===n.wrap)e.adler=0,U(n,31),U(n,139),U(n,8),n.gzhead?(U(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),U(n,255&amp;n.gzhead.time),U(n,n.gzhead.time&gt;&gt;8&amp;255),U(n,n.gzhead.time&gt;&gt;16&amp;255),U(n,n.gzhead.time&gt;&gt;24&amp;255),U(n,9===n.level?2:2&lt;=n.strategy||n.level&lt;2?4:0),U(n,255&amp;n.gzhead.os),n.gzhead.extra&amp;&amp;n.gzhead.extra.length&amp;&amp;(U(n,255&amp;n.gzhead.extra.length),U(n,n.gzhead.extra.length&gt;&gt;8&amp;255)),n.gzhead.hcrc&amp;&amp;(e.adler=p(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(U(n,0),U(n,0),U(n,0),U(n,0),U(n,0),U(n,9===n.level?2:2&lt;=n.strategy||n.level&lt;2?4:0),U(n,3),n.status=E);else{var a=v+(n.w_bits-8&lt;&lt;4)&lt;&lt;8;a|=(2&lt;=n.strategy||n.level&lt;2?0:n.level&lt;6?1:6===n.level?2:3)&lt;&lt;6,0!==n.strstart&amp;&amp;(a|=32),a+=31-a%31,n.status=E,P(n,a),0!==n.strstart&amp;&amp;(P(n,e.adler&gt;&gt;&gt;16),P(n,65535&amp;e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex&lt;(65535&amp;n.gzhead.extra.length)&amp;&amp;(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&amp;&amp;n.pending&gt;i&amp;&amp;(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending!==n.pending_buf_size));)U(n,255&amp;n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&amp;&amp;n.pending&gt;i&amp;&amp;(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&amp;&amp;(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&amp;&amp;(n.gzhead.hcrc&amp;&amp;n.pending&gt;i&amp;&amp;(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindex&lt;n.gzhead.name.length?255&amp;n.gzhead.name.charCodeAt(n.gzindex++):0,U(n,s)}while(0!==s);n.gzhead.hcrc&amp;&amp;n.pending&gt;i&amp;&amp;(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&amp;&amp;(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&amp;&amp;(n.gzhead.hcrc&amp;&amp;n.pending&gt;i&amp;&amp;(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindex&lt;n.gzhead.comment.length?255&amp;n.gzhead.comment.charCodeAt(n.gzindex++):0,U(n,s)}while(0!==s);n.gzhead.hcrc&amp;&amp;n.pending&gt;i&amp;&amp;(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&amp;&amp;(n.status=103)}else n.status=103;if(103===n.status&amp;&amp;(n.gzhead.hcrc?(n.pending+2&gt;n.pending_buf_size&amp;&amp;F(e),n.pending+2&lt;=n.pending_buf_size&amp;&amp;(U(n,255&amp;e.adler),U(n,e.adler&gt;&gt;8&amp;255),e.adler=0,n.status=E)):n.status=E),0!==n.pending){if(F(e),0===e.avail_out)return n.last_flush=-1,m}else if(0===e.avail_in&amp;&amp;T(t)&lt;=T(r)&amp;&amp;t!==f)return R(e,-5);if(666===n.status&amp;&amp;0!==e.avail_in)return R(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==l&amp;&amp;666!==n.status){var o=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&amp;&amp;(j(e),0===e.lookahead)){if(t===l)return A;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&amp;&amp;(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&amp;&amp;(N(e,!1),0===e.strm.avail_out)?A:I}(n,t):3===n.strategy?function(e,t){for(var r,n,i,s,a=e.window;;){if(e.lookahead&lt;=S){if(j(e),e.lookahead&lt;=S&amp;&amp;t===l)return A;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead&gt;=x&amp;&amp;0&lt;e.strstart&amp;&amp;(n=a[i=e.strstart-1])===a[++i]&amp;&amp;n===a[++i]&amp;&amp;n===a[++i]){s=e.strstart+S;do{}while(n===a[++i]&amp;&amp;n===a[++i]&amp;&amp;n===a[++i]&amp;&amp;n===a[++i]&amp;&amp;n===a[++i]&amp;&amp;n===a[++i]&amp;&amp;n===a[++i]&amp;&amp;n===a[++i]&amp;&amp;i&lt;s);e.match_length=S-(s-i),e.match_length&gt;e.lookahead&amp;&amp;(e.match_length=e.lookahead)}if(e.match_length&gt;=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&amp;&amp;(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&amp;&amp;(N(e,!1),0===e.strm.avail_out)?A:I}(n,t):h[n.level].func(n,t);if(o!==O&amp;&amp;o!==B||(n.status=666),o===A||o===O)return 0===e.avail_out&amp;&amp;(n.last_flush=-1),m;if(o===I&amp;&amp;(1===t?u._tr_align(n):5!==t&amp;&amp;(u._tr_stored_block(n,0,0,!1),3===t&amp;&amp;(D(n.head),0===n.lookahead&amp;&amp;(n.strstart=0,n.block_start=0,n.insert=0))),F(e),0===e.avail_out))return n.last_flush=-1,m}return t!==f?m:n.wrap&lt;=0?1:(2===n.wrap?(U(n,255&amp;e.adler),U(n,e.adler&gt;&gt;8&amp;255),U(n,e.adler&gt;&gt;16&amp;255),U(n,e.adler&gt;&gt;24&amp;255),U(n,255&amp;e.total_in),U(n,e.total_in&gt;&gt;8&amp;255),U(n,e.total_in&gt;&gt;16&amp;255),U(n,e.total_in&gt;&gt;24&amp;255)):(P(n,e.adler&gt;&gt;&gt;16),P(n,65535&amp;e.adler)),F(e),0&lt;n.wrap&amp;&amp;(n.wrap=-n.wrap),0!==n.pending?m:1)},r.deflateEnd=function(e){var t;return e&amp;&amp;e.state?(t=e.state.status)!==C&amp;&amp;69!==t&amp;&amp;73!==t&amp;&amp;91!==t&amp;&amp;103!==t&amp;&amp;t!==E&amp;&amp;666!==t?R(e,_):(e.state=null,t===E?R(e,-3):m):_},r.deflateSetDictionary=function(e,t){var r,n,i,s,a,o,h,u,l=t.length;if(!e||!e.state)return _;if(2===(s=(r=e.state).wrap)||1===s&amp;&amp;r.status!==C||r.lookahead)return _;for(1===s&amp;&amp;(e.adler=d(e.adler,t,l,0)),r.wrap=0,l&gt;=r.w_size&amp;&amp;(0===s&amp;&amp;(D(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new c.Buf8(r.w_size),c.arraySet(u,t,l-r.w_size,r.w_size,0),t=u,l=r.w_size),a=e.avail_in,o=e.next_in,h=e.input,e.avail_in=l,e.next_in=0,e.input=t,j(r);r.lookahead&gt;=x;){for(n=r.strstart,i=r.lookahead-(x-1);r.ins_h=(r.ins_h&lt;&lt;r.hash_shift^r.window[n+x-1])&amp;r.hash_mask,r.prev[n&amp;r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++,--i;);r.strstart=n,r.lookahead=x-1,j(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=x-1,r.match_available=0,e.next_in=o,e.input=h,e.avail_in=a,r.wrap=s,m},r.deflateInfo=&quot;pako deflate (from Nodeca project)&quot;},{&quot;..\/utils\/common&quot;:41,&quot;.\/adler32&quot;:43,&quot;.\/crc32&quot;:45,&quot;.\/messages&quot;:51,&quot;.\/trees&quot;:52}],47:[function(e,t,r){&quot;use strict&quot;;t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=&quot;&quot;,this.comment=&quot;&quot;,this.hcrc=0,this.done=!1}},{}],48:[function(e,t,r){&quot;use strict&quot;;t.exports=function(e,t){var r,n,i,s,a,o,h,u,l,f,c,d,p,m,_,g,b,v,y,w,k,x,S,z,C;r=e.state,n=e.next_in,z=e.input,i=n+(e.avail_in-5),s=e.next_out,C=e.output,a=s-(t-e.avail_out),o=s+(e.avail_out-257),h=r.dmax,u=r.wsize,l=r.whave,f=r.wnext,c=r.window,d=r.hold,p=r.bits,m=r.lencode,_=r.distcode,g=(1&lt;&lt;r.lenbits)-1,b=(1&lt;&lt;r.distbits)-1;e:do{p&lt;15&amp;&amp;(d+=z[n++]&lt;&lt;p,p+=8,d+=z[n++]&lt;&lt;p,p+=8),v=m[d&amp;g];t:for(;;){if(d&gt;&gt;&gt;=y=v&gt;&gt;&gt;24,p-=y,0===(y=v&gt;&gt;&gt;16&amp;255))C[s++]=65535&amp;v;else{if(!(16&amp;y)){if(0==(64&amp;y)){v=m[(65535&amp;v)+(d&amp;(1&lt;&lt;y)-1)];continue t}if(32&amp;y){r.mode=12;break e}e.msg=&quot;invalid literal\/length code&quot;,r.mode=30;break e}w=65535&amp;v,(y&amp;=15)&amp;&amp;(p&lt;y&amp;&amp;(d+=z[n++]&lt;&lt;p,p+=8),w+=d&amp;(1&lt;&lt;y)-1,d&gt;&gt;&gt;=y,p-=y),p&lt;15&amp;&amp;(d+=z[n++]&lt;&lt;p,p+=8,d+=z[n++]&lt;&lt;p,p+=8),v=_[d&amp;b];r:for(;;){if(d&gt;&gt;&gt;=y=v&gt;&gt;&gt;24,p-=y,!(16&amp;(y=v&gt;&gt;&gt;16&amp;255))){if(0==(64&amp;y)){v=_[(65535&amp;v)+(d&amp;(1&lt;&lt;y)-1)];continue r}e.msg=&quot;invalid distance code&quot;,r.mode=30;break e}if(k=65535&amp;v,p&lt;(y&amp;=15)&amp;&amp;(d+=z[n++]&lt;&lt;p,(p+=8)&lt;y&amp;&amp;(d+=z[n++]&lt;&lt;p,p+=8)),h&lt;(k+=d&amp;(1&lt;&lt;y)-1)){e.msg=&quot;invalid distance too far back&quot;,r.mode=30;break e}if(d&gt;&gt;&gt;=y,p-=y,(y=s-a)&lt;k){if(l&lt;(y=k-y)&amp;&amp;r.sane){e.msg=&quot;invalid distance too far back&quot;,r.mode=30;break e}if(S=c,(x=0)===f){if(x+=u-y,y&lt;w){for(w-=y;C[s++]=c[x++],--y;);x=s-k,S=C}}else if(f&lt;y){if(x+=u+f-y,(y-=f)&lt;w){for(w-=y;C[s++]=c[x++],--y;);if(x=0,f&lt;w){for(w-=y=f;C[s++]=c[x++],--y;);x=s-k,S=C}}}else if(x+=f-y,y&lt;w){for(w-=y;C[s++]=c[x++],--y;);x=s-k,S=C}for(;2&lt;w;)C[s++]=S[x++],C[s++]=S[x++],C[s++]=S[x++],w-=3;w&amp;&amp;(C[s++]=S[x++],1&lt;w&amp;&amp;(C[s++]=S[x++]))}else{for(x=s-k;C[s++]=C[x++],C[s++]=C[x++],C[s++]=C[x++],2&lt;(w-=3););w&amp;&amp;(C[s++]=C[x++],1&lt;w&amp;&amp;(C[s++]=C[x++]))}break}}break}}while(n&lt;i&amp;&amp;s&lt;o);n-=w=p&gt;&gt;3,d&amp;=(1&lt;&lt;(p-=w&lt;&lt;3))-1,e.next_in=n,e.next_out=s,e.avail_in=n&lt;i?i-n+5:5-(n-i),e.avail_out=s&lt;o?o-s+257:257-(s-o),r.hold=d,r.bits=p}},{}],49:[function(e,t,r){&quot;use strict&quot;;var I=e(&quot;..\/utils\/common&quot;),O=e(&quot;.\/adler32&quot;),B=e(&quot;.\/crc32&quot;),R=e(&quot;.\/inffast&quot;),T=e(&quot;.\/inftrees&quot;),D=1,F=2,N=0,U=-2,P=1,n=852,i=592;function L(e){return(e&gt;&gt;&gt;24&amp;255)+(e&gt;&gt;&gt;8&amp;65280)+((65280&amp;e)&lt;&lt;8)+((255&amp;e)&lt;&lt;24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new I.Buf16(320),this.work=new I.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&amp;&amp;e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=&quot;&quot;,t.wrap&amp;&amp;(e.adler=1&amp;t.wrap),t.mode=P,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new I.Buf32(n),t.distcode=t.distdyn=new I.Buf32(i),t.sane=1,t.back=-1,N):U}function o(e){var t;return e&amp;&amp;e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):U}function h(e,t){var r,n;return e&amp;&amp;e.state?(n=e.state,t&lt;0?(r=0,t=-t):(r=1+(t&gt;&gt;4),t&lt;48&amp;&amp;(t&amp;=15)),t&amp;&amp;(t&lt;8||15&lt;t)?U:(null!==n.window&amp;&amp;n.wbits!==t&amp;&amp;(n.window=null),n.wrap=r,n.wbits=t,o(e))):U}function u(e,t){var r,n;return e?(n=new s,(e.state=n).window=null,(r=h(e,t))!==N&amp;&amp;(e.state=null),r):U}var l,f,c=!0;function j(e){if(c){var t;for(l=new I.Buf32(512),f=new I.Buf32(32),t=0;t&lt;144;)e.lens[t++]=8;for(;t&lt;256;)e.lens[t++]=9;for(;t&lt;280;)e.lens[t++]=7;for(;t&lt;288;)e.lens[t++]=8;for(T(D,e.lens,0,288,l,0,e.work,{bits:9}),t=0;t&lt;32;)e.lens[t++]=5;T(F,e.lens,0,32,f,0,e.work,{bits:5}),c=!1}e.lencode=l,e.lenbits=9,e.distcode=f,e.distbits=5}function Z(e,t,r,n){var i,s=e.state;return null===s.window&amp;&amp;(s.wsize=1&lt;&lt;s.wbits,s.wnext=0,s.whave=0,s.window=new I.Buf8(s.wsize)),n&gt;=s.wsize?(I.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n&lt;(i=s.wsize-s.wnext)&amp;&amp;(i=n),I.arraySet(s.window,t,r-n,i,s.wnext),(n-=i)?(I.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&amp;&amp;(s.wnext=0),s.whave&lt;s.wsize&amp;&amp;(s.whave+=i))),0}r.inflateReset=o,r.inflateReset2=h,r.inflateResetKeep=a,r.inflateInit=function(e){return u(e,15)},r.inflateInit2=u,r.inflate=function(e,t){var r,n,i,s,a,o,h,u,l,f,c,d,p,m,_,g,b,v,y,w,k,x,S,z,C=0,E=new I.Buf8(4),A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&amp;&amp;0!==e.avail_in)return U;12===(r=e.state).mode&amp;&amp;(r.mode=13),a=e.next_out,i=e.output,h=e.avail_out,s=e.next_in,n=e.input,o=e.avail_in,u=r.hold,l=r.bits,f=o,c=h,x=N;e:for(;;)switch(r.mode){case P:if(0===r.wrap){r.mode=13;break}for(;l&lt;16;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}if(2&amp;r.wrap&amp;&amp;35615===u){E[r.check=0]=255&amp;u,E[1]=u&gt;&gt;&gt;8&amp;255,r.check=B(r.check,E,2,0),l=u=0,r.mode=2;break}if(r.flags=0,r.head&amp;&amp;(r.head.done=!1),!(1&amp;r.wrap)||(((255&amp;u)&lt;&lt;8)+(u&gt;&gt;8))%31){e.msg=&quot;incorrect header check&quot;,r.mode=30;break}if(8!=(15&amp;u)){e.msg=&quot;unknown compression method&quot;,r.mode=30;break}if(l-=4,k=8+(15&amp;(u&gt;&gt;&gt;=4)),0===r.wbits)r.wbits=k;else if(k&gt;r.wbits){e.msg=&quot;invalid window size&quot;,r.mode=30;break}r.dmax=1&lt;&lt;k,e.adler=r.check=1,r.mode=512&amp;u?10:12,l=u=0;break;case 2:for(;l&lt;16;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}if(r.flags=u,8!=(255&amp;r.flags)){e.msg=&quot;unknown compression method&quot;,r.mode=30;break}if(57344&amp;r.flags){e.msg=&quot;unknown header flags set&quot;,r.mode=30;break}r.head&amp;&amp;(r.head.text=u&gt;&gt;8&amp;1),512&amp;r.flags&amp;&amp;(E[0]=255&amp;u,E[1]=u&gt;&gt;&gt;8&amp;255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=3;case 3:for(;l&lt;32;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}r.head&amp;&amp;(r.head.time=u),512&amp;r.flags&amp;&amp;(E[0]=255&amp;u,E[1]=u&gt;&gt;&gt;8&amp;255,E[2]=u&gt;&gt;&gt;16&amp;255,E[3]=u&gt;&gt;&gt;24&amp;255,r.check=B(r.check,E,4,0)),l=u=0,r.mode=4;case 4:for(;l&lt;16;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}r.head&amp;&amp;(r.head.xflags=255&amp;u,r.head.os=u&gt;&gt;8),512&amp;r.flags&amp;&amp;(E[0]=255&amp;u,E[1]=u&gt;&gt;&gt;8&amp;255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=5;case 5:if(1024&amp;r.flags){for(;l&lt;16;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}r.length=u,r.head&amp;&amp;(r.head.extra_len=u),512&amp;r.flags&amp;&amp;(E[0]=255&amp;u,E[1]=u&gt;&gt;&gt;8&amp;255,r.check=B(r.check,E,2,0)),l=u=0}else r.head&amp;&amp;(r.head.extra=null);r.mode=6;case 6:if(1024&amp;r.flags&amp;&amp;(o&lt;(d=r.length)&amp;&amp;(d=o),d&amp;&amp;(r.head&amp;&amp;(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),I.arraySet(r.head.extra,n,s,d,k)),512&amp;r.flags&amp;&amp;(r.check=B(r.check,n,d,s)),o-=d,s+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&amp;r.flags){if(0===o)break e;for(d=0;k=n[s+d++],r.head&amp;&amp;k&amp;&amp;r.length&lt;65536&amp;&amp;(r.head.name+=String.fromCharCode(k)),k&amp;&amp;d&lt;o;);if(512&amp;r.flags&amp;&amp;(r.check=B(r.check,n,d,s)),o-=d,s+=d,k)break e}else r.head&amp;&amp;(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&amp;r.flags){if(0===o)break e;for(d=0;k=n[s+d++],r.head&amp;&amp;k&amp;&amp;r.length&lt;65536&amp;&amp;(r.head.comment+=String.fromCharCode(k)),k&amp;&amp;d&lt;o;);if(512&amp;r.flags&amp;&amp;(r.check=B(r.check,n,d,s)),o-=d,s+=d,k)break e}else r.head&amp;&amp;(r.head.comment=null);r.mode=9;case 9:if(512&amp;r.flags){for(;l&lt;16;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}if(u!==(65535&amp;r.check)){e.msg=&quot;header crc mismatch&quot;,r.mode=30;break}l=u=0}r.head&amp;&amp;(r.head.hcrc=r.flags&gt;&gt;9&amp;1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;l&lt;32;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}e.adler=r.check=L(u),l=u=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=a,e.avail_out=h,e.next_in=s,e.avail_in=o,r.hold=u,r.bits=l,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){u&gt;&gt;&gt;=7&amp;l,l-=7&amp;l,r.mode=27;break}for(;l&lt;3;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}switch(r.last=1&amp;u,l-=1,3&amp;(u&gt;&gt;&gt;=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==t)break;u&gt;&gt;&gt;=2,l-=2;break e;case 2:r.mode=17;break;case 3:e.msg=&quot;invalid block type&quot;,r.mode=30}u&gt;&gt;&gt;=2,l-=2;break;case 14:for(u&gt;&gt;&gt;=7&amp;l,l-=7&amp;l;l&lt;32;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}if((65535&amp;u)!=(u&gt;&gt;&gt;16^65535)){e.msg=&quot;invalid stored block lengths&quot;,r.mode=30;break}if(r.length=65535&amp;u,l=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(d=r.length){if(o&lt;d&amp;&amp;(d=o),h&lt;d&amp;&amp;(d=h),0===d)break e;I.arraySet(i,n,s,d,a),o-=d,s+=d,h-=d,a+=d,r.length-=d;break}r.mode=12;break;case 17:for(;l&lt;14;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}if(r.nlen=257+(31&amp;u),u&gt;&gt;&gt;=5,l-=5,r.ndist=1+(31&amp;u),u&gt;&gt;&gt;=5,l-=5,r.ncode=4+(15&amp;u),u&gt;&gt;&gt;=4,l-=4,286&lt;r.nlen||30&lt;r.ndist){e.msg=&quot;too many length or distance symbols&quot;,r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have&lt;r.ncode;){for(;l&lt;3;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}r.lens[A[r.have++]]=7&amp;u,u&gt;&gt;&gt;=3,l-=3}for(;r.have&lt;19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg=&quot;invalid code lengths set&quot;,r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have&lt;r.nlen+r.ndist;){for(;g=(C=r.lencode[u&amp;(1&lt;&lt;r.lenbits)-1])&gt;&gt;&gt;16&amp;255,b=65535&amp;C,!((_=C&gt;&gt;&gt;24)&lt;=l);){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}if(b&lt;16)u&gt;&gt;&gt;=_,l-=_,r.lens[r.have++]=b;else{if(16===b){for(z=_+2;l&lt;z;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}if(u&gt;&gt;&gt;=_,l-=_,0===r.have){e.msg=&quot;invalid bit length repeat&quot;,r.mode=30;break}k=r.lens[r.have-1],d=3+(3&amp;u),u&gt;&gt;&gt;=2,l-=2}else if(17===b){for(z=_+3;l&lt;z;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}l-=_,k=0,d=3+(7&amp;(u&gt;&gt;&gt;=_)),u&gt;&gt;&gt;=3,l-=3}else{for(z=_+7;l&lt;z;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}l-=_,k=0,d=11+(127&amp;(u&gt;&gt;&gt;=_)),u&gt;&gt;&gt;=7,l-=7}if(r.have+d&gt;r.nlen+r.ndist){e.msg=&quot;invalid bit length repeat&quot;,r.mode=30;break}for(;d--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg=&quot;invalid code -- missing end-of-block&quot;,r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=T(D,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg=&quot;invalid literal\/lengths set&quot;,r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg=&quot;invalid distances set&quot;,r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6&lt;=o&amp;&amp;258&lt;=h){e.next_out=a,e.avail_out=h,e.next_in=s,e.avail_in=o,r.hold=u,r.bits=l,R(e,c),a=e.next_out,i=e.output,h=e.avail_out,s=e.next_in,n=e.input,o=e.avail_in,u=r.hold,l=r.bits,12===r.mode&amp;&amp;(r.back=-1);break}for(r.back=0;g=(C=r.lencode[u&amp;(1&lt;&lt;r.lenbits)-1])&gt;&gt;&gt;16&amp;255,b=65535&amp;C,!((_=C&gt;&gt;&gt;24)&lt;=l);){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}if(g&amp;&amp;0==(240&amp;g)){for(v=_,y=g,w=b;g=(C=r.lencode[w+((u&amp;(1&lt;&lt;v+y)-1)&gt;&gt;v)])&gt;&gt;&gt;16&amp;255,b=65535&amp;C,!(v+(_=C&gt;&gt;&gt;24)&lt;=l);){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}u&gt;&gt;&gt;=v,l-=v,r.back+=v}if(u&gt;&gt;&gt;=_,l-=_,r.back+=_,r.length=b,0===g){r.mode=26;break}if(32&amp;g){r.back=-1,r.mode=12;break}if(64&amp;g){e.msg=&quot;invalid literal\/length code&quot;,r.mode=30;break}r.extra=15&amp;g,r.mode=22;case 22:if(r.extra){for(z=r.extra;l&lt;z;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}r.length+=u&amp;(1&lt;&lt;r.extra)-1,u&gt;&gt;&gt;=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;g=(C=r.distcode[u&amp;(1&lt;&lt;r.distbits)-1])&gt;&gt;&gt;16&amp;255,b=65535&amp;C,!((_=C&gt;&gt;&gt;24)&lt;=l);){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}if(0==(240&amp;g)){for(v=_,y=g,w=b;g=(C=r.distcode[w+((u&amp;(1&lt;&lt;v+y)-1)&gt;&gt;v)])&gt;&gt;&gt;16&amp;255,b=65535&amp;C,!(v+(_=C&gt;&gt;&gt;24)&lt;=l);){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}u&gt;&gt;&gt;=v,l-=v,r.back+=v}if(u&gt;&gt;&gt;=_,l-=_,r.back+=_,64&amp;g){e.msg=&quot;invalid distance code&quot;,r.mode=30;break}r.offset=b,r.extra=15&amp;g,r.mode=24;case 24:if(r.extra){for(z=r.extra;l&lt;z;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}r.offset+=u&amp;(1&lt;&lt;r.extra)-1,u&gt;&gt;&gt;=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset&gt;r.dmax){e.msg=&quot;invalid distance too far back&quot;,r.mode=30;break}r.mode=25;case 25:if(0===h)break e;if(d=c-h,r.offset&gt;d){if((d=r.offset-d)&gt;r.whave&amp;&amp;r.sane){e.msg=&quot;invalid distance too far back&quot;,r.mode=30;break}p=d&gt;r.wnext?(d-=r.wnext,r.wsize-d):r.wnext-d,d&gt;r.length&amp;&amp;(d=r.length),m=r.window}else m=i,p=a-r.offset,d=r.length;for(h&lt;d&amp;&amp;(d=h),h-=d,r.length-=d;i[a++]=m[p++],--d;);0===r.length&amp;&amp;(r.mode=21);break;case 26:if(0===h)break e;i[a++]=r.length,h--,r.mode=21;break;case 27:if(r.wrap){for(;l&lt;32;){if(0===o)break e;o--,u|=n[s++]&lt;&lt;l,l+=8}if(c-=h,e.total_out+=c,r.total+=c,c&amp;&amp;(e.adler=r.check=r.flags?B(r.check,i,c,a-c):O(r.check,i,c,a-c)),c=h,(r.flags?u:L(u))!==r.check){e.msg=&quot;incorrect data check&quot;,r.mode=30;break}l=u=0}r.mode=28;case 28:if(r.wrap&amp;&amp;r.flags){for(;l&lt;32;){if(0===o)break e;o--,u+=n[s++]&lt;&lt;l,l+=8}if(u!==(4294967295&amp;r.total)){e.msg=&quot;incorrect length check&quot;,r.mode=30;break}l=u=0}r.mode=29;case 29:x=1;break e;case 30:x=-3;break e;case 31:return-4;case 32:default:return U}return e.next_out=a,e.avail_out=h,e.next_in=s,e.avail_in=o,r.hold=u,r.bits=l,(r.wsize||c!==e.avail_out&amp;&amp;r.mode&lt;30&amp;&amp;(r.mode&lt;27||4!==t))&amp;&amp;Z(e,e.output,e.next_out,c-e.avail_out)?(r.mode=31,-4):(f-=e.avail_in,c-=e.avail_out,e.total_in+=f,e.total_out+=c,r.total+=c,r.wrap&amp;&amp;c&amp;&amp;(e.adler=r.check=r.flags?B(r.check,i,c,e.next_out-c):O(r.check,i,c,e.next_out-c)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0==f&amp;&amp;0===c||4===t)&amp;&amp;x===N&amp;&amp;(x=-5),x)},r.inflateEnd=function(e){if(!e||!e.state)return U;var t=e.state;return t.window&amp;&amp;(t.window=null),e.state=null,N},r.inflateGetHeader=function(e,t){var r;return e&amp;&amp;e.state?0==(2&amp;(r=e.state).wrap)?U:((r.head=t).done=!1,N):U},r.inflateSetDictionary=function(e,t){var r,n=t.length;return e&amp;&amp;e.state?0!==(r=e.state).wrap&amp;&amp;11!==r.mode?U:11===r.mode&amp;&amp;O(1,t,n,0)!==r.check?-3:Z(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,N):U},r.inflateInfo=&quot;pako inflate (from Nodeca project)&quot;},{&quot;..\/utils\/common&quot;:41,&quot;.\/adler32&quot;:43,&quot;.\/crc32&quot;:45,&quot;.\/inffast&quot;:48,&quot;.\/inftrees&quot;:50}],50:[function(e,t,r){&quot;use strict&quot;;var D=e(&quot;..\/utils\/common&quot;),F=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],N=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],U=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],P=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,n,i,s,a,o){var h,u,l,f,c,d,p,m,_,g=o.bits,b=0,v=0,y=0,w=0,k=0,x=0,S=0,z=0,C=0,E=0,A=null,I=0,O=new D.Buf16(16),B=new D.Buf16(16),R=null,T=0;for(b=0;b&lt;=15;b++)O[b]=0;for(v=0;v&lt;n;v++)O[t[r+v]]++;for(k=g,w=15;1&lt;=w&amp;&amp;0===O[w];w--);if(w&lt;k&amp;&amp;(k=w),0===w)return i[s++]=20971520,i[s++]=20971520,o.bits=1,0;for(y=1;y&lt;w&amp;&amp;0===O[y];y++);for(k&lt;y&amp;&amp;(k=y),b=z=1;b&lt;=15;b++)if(z&lt;&lt;=1,(z-=O[b])&lt;0)return-1;if(0&lt;z&amp;&amp;(0===e||1!==w))return-1;for(B[1]=0,b=1;b&lt;15;b++)B[b+1]=B[b]+O[b];for(v=0;v&lt;n;v++)0!==t[r+v]&amp;&amp;(a[B[t[r+v]]++]=v);if(d=0===e?(A=R=a,19):1===e?(A=F,I-=257,R=N,T-=257,256):(A=U,R=P,-1),b=y,c=s,S=v=E=0,l=-1,f=(C=1&lt;&lt;(x=k))-1,1===e&amp;&amp;852&lt;C||2===e&amp;&amp;592&lt;C)return 1;for(;;){for(p=b-S,_=a[v]&lt;d?(m=0,a[v]):a[v]&gt;d?(m=R[T+a[v]],A[I+a[v]]):(m=96,0),h=1&lt;&lt;b-S,y=u=1&lt;&lt;x;i[c+(E&gt;&gt;S)+(u-=h)]=p&lt;&lt;24|m&lt;&lt;16|_|0,0!==u;);for(h=1&lt;&lt;b-1;E&amp;h;)h&gt;&gt;=1;if(0!==h?(E&amp;=h-1,E+=h):E=0,v++,0==--O[b]){if(b===w)break;b=t[r+a[v]]}if(k&lt;b&amp;&amp;(E&amp;f)!==l){for(0===S&amp;&amp;(S=k),c+=y,z=1&lt;&lt;(x=b-S);x+S&lt;w&amp;&amp;!((z-=O[x+S])&lt;=0);)x++,z&lt;&lt;=1;if(C+=1&lt;&lt;x,1===e&amp;&amp;852&lt;C||2===e&amp;&amp;592&lt;C)return 1;i[l=E&amp;f]=k&lt;&lt;24|x&lt;&lt;16|c-s|0}}return 0!==E&amp;&amp;(i[c+E]=b-S&lt;&lt;24|64&lt;&lt;16|0),o.bits=k,0}},{&quot;..\/utils\/common&quot;:41}],51:[function(e,t,r){&quot;use strict&quot;;t.exports={2:&quot;need dictionary&quot;,1:&quot;stream end&quot;,0:&quot;&quot;,&quot;-1&quot;:&quot;file error&quot;,&quot;-2&quot;:&quot;stream error&quot;,&quot;-3&quot;:&quot;data error&quot;,&quot;-4&quot;:&quot;insufficient memory&quot;,&quot;-5&quot;:&quot;buffer error&quot;,&quot;-6&quot;:&quot;incompatible version&quot;}},{}],52:[function(e,t,r){&quot;use strict&quot;;var i=e(&quot;..\/utils\/common&quot;),o=0,h=1;function n(e){for(var t=e.length;0&lt;=--t;)e[t]=0}var s=0,a=29,u=256,l=u+1+a,f=30,c=19,_=2*l+1,g=15,d=16,p=7,m=256,b=16,v=17,y=18,w=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],k=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],S=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],z=new Array(2*(l+2));n(z);var C=new Array(2*f);n(C);var E=new Array(512);n(E);var A=new Array(256);n(A);var I=new Array(a);n(I);var O,B,R,T=new Array(f);function D(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&amp;&amp;e.length}function F(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function N(e){return e&lt;256?E[e]:E[256+(e&gt;&gt;&gt;7)]}function U(e,t){e.pending_buf[e.pending++]=255&amp;t,e.pending_buf[e.pending++]=t&gt;&gt;&gt;8&amp;255}function P(e,t,r){e.bi_valid&gt;d-r?(e.bi_buf|=t&lt;&lt;e.bi_valid&amp;65535,U(e,e.bi_buf),e.bi_buf=t&gt;&gt;d-e.bi_valid,e.bi_valid+=r-d):(e.bi_buf|=t&lt;&lt;e.bi_valid&amp;65535,e.bi_valid+=r)}function L(e,t,r){P(e,r[2*t],r[2*t+1])}function j(e,t){for(var r=0;r|=1&amp;e,e&gt;&gt;&gt;=1,r&lt;&lt;=1,0&lt;--t;);return r&gt;&gt;&gt;1}function Z(e,t,r){var n,i,s=new Array(g+1),a=0;for(n=1;n&lt;=g;n++)s[n]=a=a+r[n-1]&lt;&lt;1;for(i=0;i&lt;=t;i++){var o=e[2*i+1];0!==o&amp;&amp;(e[2*i]=j(s[o]++,o))}}function W(e){var t;for(t=0;t&lt;l;t++)e.dyn_ltree[2*t]=0;for(t=0;t&lt;f;t++)e.dyn_dtree[2*t]=0;for(t=0;t&lt;c;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*m]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function M(e){8&lt;e.bi_valid?U(e,e.bi_buf):0&lt;e.bi_valid&amp;&amp;(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function H(e,t,r,n){var i=2*t,s=2*r;return e[i]&lt;e[s]||e[i]===e[s]&amp;&amp;n[t]&lt;=n[r]}function G(e,t,r){for(var n=e.heap[r],i=r&lt;&lt;1;i&lt;=e.heap_len&amp;&amp;(i&lt;e.heap_len&amp;&amp;H(t,e.heap[i+1],e.heap[i],e.depth)&amp;&amp;i++,!H(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i&lt;&lt;=1;e.heap[r]=n}function K(e,t,r){var n,i,s,a,o=0;if(0!==e.last_lit)for(;n=e.pending_buf[e.d_buf+2*o]&lt;&lt;8|e.pending_buf[e.d_buf+2*o+1],i=e.pending_buf[e.l_buf+o],o++,0===n?L(e,i,t):(L(e,(s=A[i])+u+1,t),0!==(a=w[s])&amp;&amp;P(e,i-=I[s],a),L(e,s=N(--n),r),0!==(a=k[s])&amp;&amp;P(e,n-=T[s],a)),o&lt;e.last_lit;);L(e,m,t)}function Y(e,t){var r,n,i,s=t.dyn_tree,a=t.stat_desc.static_tree,o=t.stat_desc.has_stree,h=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=_,r=0;r&lt;h;r++)0!==s[2*r]?(e.heap[++e.heap_len]=u=r,e.depth[r]=0):s[2*r+1]=0;for(;e.heap_len&lt;2;)s[2*(i=e.heap[++e.heap_len]=u&lt;2?++u:0)]=1,e.depth[i]=0,e.opt_len--,o&amp;&amp;(e.static_len-=a[2*i+1]);for(t.max_code=u,r=e.heap_len&gt;&gt;1;1&lt;=r;r--)G(e,s,r);for(i=h;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]&gt;=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,G(e,s,1),2&lt;=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,a,o,h=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(s=0;s&lt;=g;s++)e.bl_count[s]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r&lt;_;r++)p&lt;(s=h[2*h[2*(n=e.heap[r])+1]+1]+1)&amp;&amp;(s=p,m++),h[2*n+1]=s,u&lt;n||(e.bl_count[s]++,a=0,d&lt;=n&amp;&amp;(a=c[n-d]),o=h[2*n],e.opt_len+=o*(s+a),f&amp;&amp;(e.static_len+=o*(l[2*n+1]+a)));if(0!==m){do{for(s=p-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[p]--,m-=2}while(0&lt;m);for(s=p;0!==s;s--)for(n=e.bl_count[s];0!==n;)u&lt;(i=e.heap[--r])||(h[2*i+1]!==s&amp;&amp;(e.opt_len+=(s-h[2*i+1])*h[2*i],h[2*i+1]=s),n--)}}(e,t),Z(s,u,e.bl_count)}function X(e,t,r){var n,i,s=-1,a=t[1],o=0,h=7,u=4;for(0===a&amp;&amp;(h=138,u=3),t[2*(r+1)+1]=65535,n=0;n&lt;=r;n++)i=a,a=t[2*(n+1)+1],++o&lt;h&amp;&amp;i===a||(o&lt;u?e.bl_tree[2*i]+=o:0!==i?(i!==s&amp;&amp;e.bl_tree[2*i]++,e.bl_tree[2*b]++):o&lt;=10?e.bl_tree[2*v]++:e.bl_tree[2*y]++,s=i,u=(o=0)===a?(h=138,3):i===a?(h=6,3):(h=7,4))}function V(e,t,r){var n,i,s=-1,a=t[1],o=0,h=7,u=4;for(0===a&amp;&amp;(h=138,u=3),n=0;n&lt;=r;n++)if(i=a,a=t[2*(n+1)+1],!(++o&lt;h&amp;&amp;i===a)){if(o&lt;u)for(;L(e,i,e.bl_tree),0!=--o;);else 0!==i?(i!==s&amp;&amp;(L(e,i,e.bl_tree),o--),L(e,b,e.bl_tree),P(e,o-3,2)):o&lt;=10?(L(e,v,e.bl_tree),P(e,o-3,3)):(L(e,y,e.bl_tree),P(e,o-11,7));s=i,u=(o=0)===a?(h=138,3):i===a?(h=6,3):(h=7,4)}}n(T);var q=!1;function J(e,t,r,n){P(e,(s&lt;&lt;1)+(n?1:0),3),function(e,t,r,n){M(e),n&amp;&amp;(U(e,r),U(e,~r)),i.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}r._tr_init=function(e){q||(function(){var e,t,r,n,i,s=new Array(g+1);for(n=r=0;n&lt;a-1;n++)for(I[n]=r,e=0;e&lt;1&lt;&lt;w[n];e++)A[r++]=n;for(A[r-1]=n,n=i=0;n&lt;16;n++)for(T[n]=i,e=0;e&lt;1&lt;&lt;k[n];e++)E[i++]=n;for(i&gt;&gt;=7;n&lt;f;n++)for(T[n]=i&lt;&lt;7,e=0;e&lt;1&lt;&lt;k[n]-7;e++)E[256+i++]=n;for(t=0;t&lt;=g;t++)s[t]=0;for(e=0;e&lt;=143;)z[2*e+1]=8,e++,s[8]++;for(;e&lt;=255;)z[2*e+1]=9,e++,s[9]++;for(;e&lt;=279;)z[2*e+1]=7,e++,s[7]++;for(;e&lt;=287;)z[2*e+1]=8,e++,s[8]++;for(Z(z,l+1,s),e=0;e&lt;f;e++)C[2*e+1]=5,C[2*e]=j(e,5);O=new D(z,w,u+1,l,g),B=new D(C,k,0,f,g),R=new D(new Array(0),x,0,c,p)}(),q=!0),e.l_desc=new F(e.dyn_ltree,O),e.d_desc=new F(e.dyn_dtree,B),e.bl_desc=new F(e.bl_tree,R),e.bi_buf=0,e.bi_valid=0,W(e)},r._tr_stored_block=J,r._tr_flush_block=function(e,t,r,n){var i,s,a=0;0&lt;e.level?(2===e.strm.data_type&amp;&amp;(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t&lt;=31;t++,r&gt;&gt;&gt;=1)if(1&amp;r&amp;&amp;0!==e.dyn_ltree[2*t])return o;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return h;for(t=32;t&lt;u;t++)if(0!==e.dyn_ltree[2*t])return h;return o}(e)),Y(e,e.l_desc),Y(e,e.d_desc),a=function(e){var t;for(X(e,e.dyn_ltree,e.l_desc.max_code),X(e,e.dyn_dtree,e.d_desc.max_code),Y(e,e.bl_desc),t=c-1;3&lt;=t&amp;&amp;0===e.bl_tree[2*S[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7&gt;&gt;&gt;3,(s=e.static_len+3+7&gt;&gt;&gt;3)&lt;=i&amp;&amp;(i=s)):i=s=r+5,r+4&lt;=i&amp;&amp;-1!==t?J(e,t,r,n):4===e.strategy||s===i?(P(e,2+(n?1:0),3),K(e,z,C)):(P(e,4+(n?1:0),3),function(e,t,r,n){var i;for(P(e,t-257,5),P(e,r-1,5),P(e,n-4,4),i=0;i&lt;n;i++)P(e,e.bl_tree[2*S[i]+1],3);V(e,e.dyn_ltree,t-1),V(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),K(e,e.dyn_ltree,e.dyn_dtree)),W(e),n&amp;&amp;M(e)},r._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t&gt;&gt;&gt;8&amp;255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&amp;t,e.pending_buf[e.l_buf+e.last_lit]=255&amp;r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(A[r]+u+1)]++,e.dyn_dtree[2*N(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){P(e,2,3),L(e,m,z),function(e){16===e.bi_valid?(U(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8&lt;=e.bi_valid&amp;&amp;(e.pending_buf[e.pending++]=255&amp;e.bi_buf,e.bi_buf&gt;&gt;=8,e.bi_valid-=8)}(e)}},{&quot;..\/utils\/common&quot;:41}],53:[function(e,t,r){&quot;use strict&quot;;t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=&quot;&quot;,this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){(function(e){!function(r,n){&quot;use strict&quot;;if(!r.setImmediate){var i,s,t,a,o=1,h={},u=!1,l=r.document,e=Object.getPrototypeOf&amp;&amp;Object.getPrototypeOf(r);e=e&amp;&amp;e.setTimeout?e:r,i=&quot;[object process]&quot;==={}.toString.call(r.process)?function(e){process.nextTick(function(){c(e)})}:function(){if(r.postMessage&amp;&amp;!r.importScripts){var e=!0,t=r.onmessage;return r.onmessage=function(){e=!1},r.postMessage(&quot;&quot;,&quot;*&quot;),r.onmessage=t,e}}()?(a=&quot;setImmediate$&quot;+Math.random()+&quot;$&quot;,r.addEventListener?r.addEventListener(&quot;message&quot;,d,!1):r.attachEvent(&quot;onmessage&quot;,d),function(e){r.postMessage(a+e,&quot;*&quot;)}):r.MessageChannel?((t=new MessageChannel).port1.onmessage=function(e){c(e.data)},function(e){t.port2.postMessage(e)}):l&amp;&amp;&quot;onreadystatechange&quot;in l.createElement(&quot;script&quot;)?(s=l.documentElement,function(e){var t=l.createElement(&quot;script&quot;);t.onreadystatechange=function(){c(e),t.onreadystatechange=null,s.removeChild(t),t=null},s.appendChild(t)}):function(e){setTimeout(c,0,e)},e.setImmediate=function(e){&quot;function&quot;!=typeof e&amp;&amp;(e=new Function(&quot;&quot;+e));for(var t=new Array(arguments.length-1),r=0;r&lt;t.length;r++)t[r]=arguments[r+1];var n={callback:e,args:t};return h[o]=n,i(o),o++},e.clearImmediate=f}function f(e){delete h[e]}function c(e){if(u)setTimeout(c,0,e);else{var t=h[e];if(t){u=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{f(e),u=!1}}}}function d(e){e.source===r&amp;&amp;&quot;string&quot;==typeof e.data&amp;&amp;0===e.data.indexOf(a)&amp;&amp;c(+e.data.slice(a.length))}}(&quot;undefined&quot;==typeof self?void 0===e?this:e:self)}).call(this,&quot;undefined&quot;!=typeof global?global:&quot;undefined&quot;!=typeof self?self:&quot;undefined&quot;!=typeof window?window:{})},{}]},{},[10])(10)});&lt;\/script&gt;&lt;script&gt;\/* \u95ea\u5f97\u56fe\u7247\u5de5\u4f5c\u53f0\uff1a\u7eaf\u6d4f\u89c8\u5668\u56fe\u50cf\u5904\u7406\u3002\u4e0d\u4f1a\u4e0a\u4f20\u7528\u6237\u56fe\u7247\u6216\u8c03\u7528\u8fdc\u7a0b\u670d\u52a1\u3002 *\/\r\n(function (global) {\r\n  &#039;use strict&#039;;\r\n\r\n  const LIMITS = Object.freeze({ maxDimension: 8192, maxPixels: 32000000, maxScenePixels: 16000000, maxFileBytes: 40 * 1024 * 1024, maxFiles: 30, maxBatchPixels: 64000000, maxSelectionPieces: 30, maxSelectionPixels: 16000000, maxSelectionZipBytes: 100 * 1024 * 1024 });\r\n  const MIME = Object.freeze({ png: &#039;image\/png&#039;, jpeg: &#039;image\/jpeg&#039;, webp: &#039;image\/webp&#039; });\r\n  function fail(message, code) { const error = new Error(message); error.code = code || &#039;invalid_image&#039;; throw error; }\r\n  function number(value, fallback) { const n = Number(value); return Number.isFinite(n) ? n : fallback; }\r\n  function clamp(value, min, max) { return Math.min(max, Math.max(min, value)); }\r\n  function dimension(value) { return Math.max(1, Math.round(number(value, 1))); }\r\n  function validateDimensions(width, height, maxPixels) {\r\n    if (!Number.isFinite(Number(width)) || !Number.isFinite(Number(height)) || Number(width) &lt;= 0 || Number(height) &lt;= 0) fail(&#039;\u56fe\u7247\u5c3a\u5bf8\u5fc5\u987b\u4e3a\u6b63\u6570\u3002&#039;, &#039;invalid_dimensions&#039;);\r\n    width = dimension(width); height = dimension(height);\r\n    if (width &gt; LIMITS.maxDimension || height &gt; LIMITS.maxDimension || width * height &gt; (maxPixels || LIMITS.maxPixels)) fail(&#039;\u56fe\u7247\u5c3a\u5bf8\u8fc7\u5927\uff0c\u8bf7\u7f29\u5c0f\u540e\u518d\u5904\u7406\u3002\u5355\u8fb9\u4e0d\u8d85\u8fc78192\u50cf\u7d20\uff0c\u56fe\u7247\u603b\u50cf\u7d20\u4e0d\u8d85\u8fc73200\u4e07\uff1b\u753b\u5e03\u4e0d\u8d85\u8fc71600\u4e07\u50cf\u7d20\u3002&#039;, &#039;dimension_limit&#039;);\r\n    return { width, height };\r\n  }\r\n  function createCanvas(width, height, options) {\r\n    const size = validateDimensions(width, height, options &amp;&amp; options.maxPixels);\r\n    const canvas = document.createElement(&#039;canvas&#039;); canvas.width = size.width; canvas.height = size.height;\r\n    const context = canvas.getContext(&#039;2d&#039;, { willReadFrequently: true });\r\n    if (!context) fail(&#039;\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u56fe\u7247\u7f16\u8f91\u753b\u5e03\u3002&#039;, &#039;canvas_unavailable&#039;);\r\n    return canvas;\r\n  }\r\n  function context(canvas) {\r\n    if (!canvas || !canvas.width || !canvas.height || typeof canvas.getContext !== &#039;function&#039;) fail(&#039;\u672a\u627e\u5230\u53ef\u5904\u7406\u7684\u56fe\u7247\u3002&#039;);\r\n    const ctx = canvas.getContext(&#039;2d&#039;, { willReadFrequently: true });\r\n    if (!ctx) fail(&#039;\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u56fe\u7247\u7f16\u8f91\u753b\u5e03\u3002&#039;);\r\n    return ctx;\r\n  }\r\n  function copy(canvas) { const out = createCanvas(canvas.width, canvas.height); context(out).drawImage(canvas, 0, 0); return out; }\r\n  function clearCanvas(canvas) { context(canvas).clearRect(0, 0, canvas.width, canvas.height); }\r\n  function release(canvas) { if (canvas &amp;&amp; typeof canvas.getContext === &#039;function&#039;) { canvas.width = 1; canvas.height = 1; } }\r\n\r\n  async function inspectFile(file) {\r\n    if (!file || typeof file.slice !== &#039;function&#039; || typeof file.size !== &#039;number&#039;) fail(&#039;\u8bf7\u9009\u62e9\u56fe\u7247\u6587\u4ef6\u3002&#039;, &#039;invalid_file&#039;);\r\n    if (!file.size || file.size &gt; LIMITS.maxFileBytes) fail(&#039;\u6bcf\u5f20\u56fe\u7247\u987b\u5c0f\u4e8e40MB\u4e14\u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a\u3002&#039;, &#039;file_limit&#039;);\r\n    const head = new Uint8Array(await file.slice(0, 32).arrayBuffer());\r\n    let format = &#039;&#039;;\r\n    if (head.length &gt;= 8 &amp;&amp; head[0] === 137 &amp;&amp; head[1] === 80 &amp;&amp; head[2] === 78 &amp;&amp; head[3] === 71 &amp;&amp; head[4] === 13 &amp;&amp; head[5] === 10 &amp;&amp; head[6] === 26 &amp;&amp; head[7] === 10) format = &#039;png&#039;;\r\n    else if (head.length &gt;= 3 &amp;&amp; head[0] === 255 &amp;&amp; head[1] === 216 &amp;&amp; head[2] === 255) format = &#039;jpeg&#039;;\r\n    else if (head.length &gt;= 12 &amp;&amp; String.fromCharCode.apply(null, head.slice(0, 4)) === &#039;RIFF&#039; &amp;&amp; String.fromCharCode.apply(null, head.slice(8, 12)) === &#039;WEBP&#039;) format = &#039;webp&#039;;\r\n    if (!format) fail(&#039;\u4ec5\u652f\u6301\u771f\u5b9e\u7684PNG\u3001JPG\u548cWebP\u56fe\u7247\uff0c\u4e0d\u652f\u6301SVG\u6216\u4f2a\u88c5\u56fe\u7247\u3002&#039;, &#039;unsupported_format&#039;);\r\n    \/\/ \u89e3\u7801\u524d\u9a8c\u8bc1\u6587\u4ef6\u4e2d\u7684\u5c3a\u5bf8\uff0c\u907f\u514d\u8d85\u5927\u538b\u7f29\u56fe\u7247\u5148\u5360\u7528\u5de8\u989d\u5185\u5b58\u518d\u88ab\u62d2\u7edd\u3002\r\n    const encodedSize = await encodedDimensions(file, format, head);\r\n    validateDimensions(encodedSize.width, encodedSize.height);\r\n    return { format, mime: MIME[format], name: safeFilename(file.name || &#039;\u56fe\u7247.&#039; + (format === &#039;jpeg&#039; ? &#039;jpg&#039; : format)), bytes: file.size, width: encodedSize.width, height: encodedSize.height };\r\n  }\r\n  async function encodedDimensions(file, format, head) {\r\n    const u16 = (bytes, index) =&gt; (bytes[index] &lt;&lt; 8) | bytes[index + 1];\r\n    if (format === &#039;png&#039; &amp;&amp; head.length &gt;= 24) { const view = new DataView(head.buffer, head.byteOffset, head.byteLength); return { width: view.getUint32(16), height: view.getUint32(20) }; }\r\n    if (format === &#039;webp&#039;) {\r\n      const chunk = String.fromCharCode.apply(null, head.slice(12, 16));\r\n      if (chunk === &#039;VP8X&#039; &amp;&amp; head.length &gt;= 30) return { width: 1 + head[24] + (head[25] &lt;&lt; 8) + (head[26] &lt;&lt; 16), height: 1 + head[27] + (head[28] &lt;&lt; 8) + (head[29] &lt;&lt; 16) };\r\n      if (chunk === &#039;VP8L&#039; &amp;&amp; head.length &gt;= 25 &amp;&amp; head[20] === 47) return { width: 1 + head[21] + ((head[22] &amp; 63) &lt;&lt; 8), height: 1 + (head[22] &gt;&gt; 6) + (head[23] &lt;&lt; 2) + ((head[24] &amp; 15) &lt;&lt; 10) };\r\n      if (chunk === &#039;VP8 &#039; &amp;&amp; head.length &gt;= 30 &amp;&amp; head[23] === 157 &amp;&amp; head[24] === 1 &amp;&amp; head[25] === 42) return { width: (head[26] | (head[27] &lt;&lt; 8)) &amp; 16383, height: (head[28] | (head[29] &lt;&lt; 8)) &amp; 16383 };\r\n    }\r\n    if (format === &#039;jpeg&#039;) {\r\n      const bytes = new Uint8Array(await file.slice(0, Math.min(file.size, 1024 * 1024)).arrayBuffer()); let position = 2;\r\n      while (position + 3 &lt; bytes.length) {\r\n        if (bytes[position++] !== 255) fail(&#039;JPG\u6587\u4ef6\u7ed3\u6784\u4e0d\u5b8c\u6574\u3002&#039;, &#039;invalid_file&#039;);\r\n        while (bytes[position] === 255) position++;\r\n        const marker = bytes[position++]; if (marker === 217 || marker === 218) break;\r\n        if (marker === 216 || marker === 1 || (marker &gt;= 208 &amp;&amp; marker &lt;= 215)) continue;\r\n        if (position + 1 &gt;= bytes.length) break; const length = u16(bytes, position);\r\n        if (length &lt; 2 || position + length &gt; bytes.length) break;\r\n        if ([192, 193, 194, 195, 197, 198, 199, 201, 202, 203, 205, 206, 207].includes(marker) &amp;&amp; length &gt;= 7) return { width: u16(bytes, position + 5), height: u16(bytes, position + 3) };\r\n        position += length;\r\n      }\r\n    }\r\n    fail(&#039;\u65e0\u6cd5\u5b89\u5168\u8bc6\u522b\u56fe\u7247\u5c3a\u5bf8\uff0c\u8bf7\u8f6c\u6362\u4e3a\u6807\u51c6PNG\u6216JPG\u540e\u91cd\u8bd5\u3002&#039;, &#039;invalid_file&#039;);\r\n  }\r\n  async function decodeFile(file) {\r\n    if (typeof global.createImageBitmap === &#039;function&#039;) {\r\n      try { return await global.createImageBitmap(file, { imageOrientation: &#039;from-image&#039; }); } catch (error) { \/* \u90e8\u5206\u6d4f\u89c8\u5668\u9700\u4f7f\u7528HTMLImageElement\u3002 *\/ }\r\n    }\r\n    const url = URL.createObjectURL(file);\r\n    try {\r\n      const image = new Image(); image.decoding = &#039;async&#039;;\r\n      await new Promise((resolve, reject) =&gt; { image.onload = resolve; image.onerror = () =&gt; reject(new Error(&#039;\u56fe\u7247\u89e3\u7801\u5931\u8d25\uff0c\u8bf7\u786e\u8ba4\u6587\u4ef6\u5b8c\u6574\u3002&#039;)); image.src = url; });\r\n      return image;\r\n    } finally { URL.revokeObjectURL(url); }\r\n  }\r\n  async function loadFile(file) {\r\n    const info = await inspectFile(file); let decoded;\r\n    try {\r\n      decoded = await decodeFile(file);\r\n      const size = validateDimensions(decoded.width || decoded.naturalWidth, decoded.height || decoded.naturalHeight);\r\n      const canvas = createCanvas(size.width, size.height); context(canvas).drawImage(decoded, 0, 0);\r\n      canvas.sourceInfo = Object.assign({}, info, size);\r\n      return canvas;\r\n    } catch (error) { if (error.code) throw error; fail(&#039;\u56fe\u7247\u89e3\u7801\u5931\u8d25\uff0c\u8bf7\u786e\u8ba4\u6587\u4ef6\u5b8c\u6574\u3002&#039;, &#039;decode_failed&#039;); }\r\n    finally { if (decoded &amp;&amp; typeof decoded.close === &#039;function&#039;) decoded.close(); }\r\n  }\r\n  async function loadFiles(files, options) {\r\n    const list = Array.from(files || []); options = options || {};\r\n    if (!list.length) fail(&#039;\u8bf7\u9009\u62e9\u81f3\u5c11\u4e00\u5f20\u56fe\u7247\u3002&#039;, &#039;empty_batch&#039;);\r\n    if (list.length &gt; LIMITS.maxFiles) fail(&#039;\u4e00\u6b21\u6700\u591a\u5bfc\u516530\u5f20\u56fe\u7247\u3002&#039;, &#039;batch_limit&#039;);\r\n    let bytes = 0, preflightPixels = number(options.existingPixels, 0);\r\n    for (const file of list) { const info = await inspectFile(file); bytes += file.size; preflightPixels += info.width * info.height; }\r\n    if (bytes &gt; 200 * 1024 * 1024) fail(&#039;\u672c\u6b21\u56fe\u7247\u603b\u6587\u4ef6\u91cf\u8d85\u8fc7200MB\uff0c\u8bf7\u5206\u6279\u5bfc\u5165\u3002&#039;, &#039;batch_memory_limit&#039;);\r\n    if (preflightPixels &gt; LIMITS.maxBatchPixels) fail(&#039;\u672c\u6b21\u56fe\u7247\u603b\u50cf\u7d20\u8d85\u8fc76400\u4e07\uff0c\u8bf7\u5206\u6279\u5bfc\u5165\u3002&#039;, &#039;batch_memory_limit&#039;);\r\n    const canvases = []; let pixels = number(options.existingPixels, 0);\r\n    try {\r\n      for (let i = 0; i &lt; list.length; i++) {\r\n        const canvas = await loadFile(list[i]); pixels += canvas.width * canvas.height;\r\n        if (pixels &gt; LIMITS.maxBatchPixels) { release(canvas); fail(&#039;\u672c\u6b21\u56fe\u7247\u603b\u50cf\u7d20\u8d85\u8fc76400\u4e07\uff0c\u8bf7\u5206\u6279\u5bfc\u5165\u3002&#039;, &#039;batch_memory_limit&#039;); }\r\n        canvases.push(canvas); if (options.onProgress) options.onProgress(i + 1, list.length);\r\n      }\r\n      return canvases;\r\n    } catch (error) { canvases.forEach(release); throw error; }\r\n  }\r\n\r\n  function adjust(canvas, options) {\r\n    options = options || {}; const out = copy(canvas); const ctx = context(out);\r\n    const data = ctx.getImageData(0, 0, out.width, out.height); const pixels = data.data;\r\n    const brightness = clamp(number(options.brightness, 0), -100, 100) * 2.55;\r\n    const contrast = clamp(number(options.contrast, 0), -100, 100);\r\n    const contrastFactor = (259 * (contrast * 2.55 + 255)) \/ (255 * (259 - contrast * 2.55));\r\n    const saturation = Math.max(0, 1 + clamp(number(options.saturation, 0), -100, 100) \/ 100);\r\n    const temperature = clamp(number(options.temperature, 0), -100, 100) * 0.65;\r\n    const gray = clamp(number(options.grayscale, 0), 0, 100) \/ 100;\r\n    for (let i = 0; i &lt; pixels.length; i += 4) {\r\n      let red = contrastFactor * (pixels[i] - 128) + 128 + brightness + temperature;\r\n      let green = contrastFactor * (pixels[i + 1] - 128) + 128 + brightness;\r\n      let blue = contrastFactor * (pixels[i + 2] - 128) + 128 + brightness - temperature;\r\n      const luminance = red * 0.2126 + green * 0.7152 + blue * 0.0722;\r\n      red = luminance + (red - luminance) * saturation; green = luminance + (green - luminance) * saturation; blue = luminance + (blue - luminance) * saturation;\r\n      pixels[i] = clamp(red * (1 - gray) + luminance * gray, 0, 255);\r\n      pixels[i + 1] = clamp(green * (1 - gray) + luminance * gray, 0, 255);\r\n      pixels[i + 2] = clamp(blue * (1 - gray) + luminance * gray, 0, 255);\r\n    }\r\n    ctx.putImageData(data, 0, 0); return out;\r\n  }\r\n  function transform(canvas, options) {\r\n    options = options || {}; const turns = ((Math.round(number(options.quarterTurns !== undefined ? options.quarterTurns : options.rotate, 0)) % 4) + 4) % 4;\r\n    const out = createCanvas(turns % 2 ? canvas.height : canvas.width, turns % 2 ? canvas.width : canvas.height); const ctx = context(out);\r\n    ctx.translate(out.width \/ 2, out.height \/ 2); ctx.rotate(turns * Math.PI \/ 2); ctx.scale(options.flipX ? -1 : 1, options.flipY ? -1 : 1);\r\n    ctx.drawImage(canvas, -canvas.width \/ 2, -canvas.height \/ 2); return out;\r\n  }\r\n  function resize(canvas, width, height, options) {\r\n    if (typeof width === &#039;object&#039;) { options = width; height = width.height; width = width.width; }\r\n    options = options || {}; const out = createCanvas(width, height); const ctx = context(out);\r\n    ctx.imageSmoothingEnabled = options.smoothing !== false; ctx.imageSmoothingQuality = &#039;high&#039;;\r\n    ctx.drawImage(canvas, 0, 0, out.width, out.height); return out;\r\n  }\r\n  function normalizeRect(rect, width, height) {\r\n    rect = rect || {}; let x = number(rect.x, 0), y = number(rect.y, 0), rw = number(rect.width, width), rh = number(rect.height, height);\r\n    if (rw &lt; 0) { x += rw; rw = -rw; } if (rh &lt; 0) { y += rh; rh = -rh; }\r\n    const left = clamp(Math.floor(x), 0, width), top = clamp(Math.floor(y), 0, height);\r\n    const right = clamp(Math.ceil(x + rw), 0, width), bottom = clamp(Math.ceil(y + rh), 0, height);\r\n    if (right &lt;= left || bottom &lt;= top) fail(&#039;\u9009\u533a\u6ca1\u6709\u8986\u76d6\u56fe\u7247\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002&#039;, &#039;empty_selection&#039;);\r\n    return { x: left, y: top, width: right - left, height: bottom - top };\r\n  }\r\n  function crop(canvas, rect) { const area = normalizeRect(rect, canvas.width, canvas.height); const out = createCanvas(area.width, area.height); context(out).drawImage(canvas, area.x, area.y, area.width, area.height, 0, 0, area.width, area.height); return out; }\r\n  function trimTransparent(canvas, options) {\r\n    options = options || {}; const threshold = clamp(number(options.threshold, 0), 0, 254); const pixels = context(canvas).getImageData(0, 0, canvas.width, canvas.height).data;\r\n    let left = canvas.width, top = canvas.height, right = -1, bottom = -1;\r\n    for (let y = 0; y &lt; canvas.height; y++) for (let x = 0; x &lt; canvas.width; x++) if (pixels[(y * canvas.width + x) * 4 + 3] &gt; threshold) { left = Math.min(left, x); right = Math.max(right, x); top = Math.min(top, y); bottom = Math.max(bottom, y); }\r\n    if (right &lt; left) { const blank = createCanvas(1, 1); blank.trimBounds = null; return blank; }\r\n    const padding = Math.max(0, Math.round(number(options.padding, 0)));\r\n    const area = { x: Math.max(0, left - padding), y: Math.max(0, top - padding), width: Math.min(canvas.width, right + 1 + padding) - Math.max(0, left - padding), height: Math.min(canvas.height, bottom + 1 + padding) - Math.max(0, top - padding) };\r\n    const out = crop(canvas, area); out.trimBounds = area; return out;\r\n  }\r\n  function selectionBounds(selection, canvas) {\r\n    if (!selection) fail(&#039;\u8bf7\u5148\u6846\u9009\u3001\u5708\u9009\u6216\u81ea\u7531\u9009\u53d6\u533a\u57df\u3002&#039;, &#039;empty_selection&#039;);\r\n    if (selection.type === &#039;compound&#039;) {\r\n      if (!Array.isArray(selection.parts) || !selection.parts.length || selection.parts.length &gt; 24) fail(&#039;\u9009\u533a\u64cd\u4f5c\u6700\u591a24\u6b65\uff0c\u8bf7\u5148\u5bfc\u51fa\u5f53\u524d\u7d20\u6750\u3002&#039;, &#039;invalid_selection&#039;);\r\n      const areas = selection.parts.filter(p=&gt;p.op===&#039;add&#039;).map(p=&gt;selectionBounds(p.selection,canvas));\r\n      if (!areas.length) fail(&#039;\u8bf7\u5148\u521b\u5efa\u4e00\u4e2a\u9009\u533a\u3002&#039;, &#039;empty_selection&#039;);\r\n      const x=Math.min(...areas.map(b=&gt;b.x)), y=Math.min(...areas.map(b=&gt;b.y));\r\n      return normalizeRect({x,y,width:Math.max(...areas.map(b=&gt;b.x+b.width))-x,height:Math.max(...areas.map(b=&gt;b.y+b.height))-y},canvas.width,canvas.height);\r\n    }\r\n    if (selection.type === &#039;lasso&#039;) {\r\n      const points = selection.points || []; if (points.length &lt; 3) fail(&#039;\u81ea\u7531\u9009\u533a\u81f3\u5c11\u9700\u89813\u4e2a\u70b9\u3002&#039;, &#039;empty_selection&#039;);\r\n      const limits = points.reduce((b, p) =&gt; { const x = number(p.x, 0), y = number(p.y, 0); b.left = Math.min(b.left, x); b.right = Math.max(b.right, x); b.top = Math.min(b.top, y); b.bottom = Math.max(b.bottom, y); return b; }, { left: Infinity, right: -Infinity, top: Infinity, bottom: -Infinity });\r\n      return normalizeRect({ x: limits.left, y: limits.top, width: limits.right - limits.left, height: limits.bottom - limits.top }, canvas.width, canvas.height);\r\n    }\r\n    if (selection.type &amp;&amp; selection.type !== &#039;rect&#039; &amp;&amp; selection.type !== &#039;ellipse&#039;) fail(&#039;\u4e0d\u652f\u6301\u7684\u9009\u533a\u7c7b\u578b\u3002&#039;, &#039;invalid_selection&#039;);\r\n    return normalizeRect(selection, canvas.width, canvas.height);\r\n  }\r\n  function selectionPath(ctx, selection) {\r\n    ctx.beginPath();\r\n    if (selection.type === &#039;compound&#039;) {\r\n      \/\/ An outline of each edited region; the extraction mask below uses real add\/subtract composition.\r\n      for (const part of selection.parts) {\r\n        const shape=part.selection, reverse=part.op===&#039;subtract&#039;;\r\n        if(shape.type===&#039;lasso&#039;){let points=shape.points;const area=points.reduce((n,p,i)=&gt;{const q=points[(i+1)%points.length];return n+p.x*q.y-q.x*p.y;},0);if((area&lt;0)!==reverse)points=[...points].reverse();ctx.moveTo(points[0].x,points[0].y);for(let i=1;i&lt;points.length;i++)ctx.lineTo(points[i].x,points[i].y);ctx.closePath();}\r\n        else if(shape.type===&#039;ellipse&#039;)ctx.ellipse(shape.x+shape.width\/2,shape.y+shape.height\/2,shape.width\/2,shape.height\/2,0,0,Math.PI*2,reverse);\r\n        else if(reverse){ctx.moveTo(shape.x,shape.y);ctx.lineTo(shape.x,shape.y+shape.height);ctx.lineTo(shape.x+shape.width,shape.y+shape.height);ctx.lineTo(shape.x+shape.width,shape.y);ctx.closePath();}\r\n        else ctx.rect(shape.x,shape.y,shape.width,shape.height);\r\n      }\r\n      return;\r\n    }\r\n    if (selection.type === &#039;lasso&#039;) {\r\n      const points = selection.points; ctx.moveTo(number(points[0].x, 0), number(points[0].y, 0));\r\n      for (let i = 1; i &lt; points.length; i++) ctx.lineTo(number(points[i].x, 0), number(points[i].y, 0)); ctx.closePath();\r\n    } else {\r\n      let x = number(selection.x, 0), y = number(selection.y, 0), w = number(selection.width, 0), h = number(selection.height, 0);\r\n      if (w &lt; 0) { x += w; w = -w; } if (h &lt; 0) { y += h; h = -h; }\r\n      if (selection.type === &#039;ellipse&#039;) ctx.ellipse(x + w \/ 2, y + h \/ 2, w \/ 2, h \/ 2, 0, 0, Math.PI * 2); else ctx.rect(x, y, w, h);\r\n    }\r\n  }\r\n  function featherSelectionMask(mask, radius) {\r\n    radius=Math.round(clamp(number(radius,0),0,24));if(!radius)return;\r\n    const ctx=context(mask),data=ctx.getImageData(0,0,mask.width,mask.height),w=mask.width,h=mask.height;\r\n    let input=new Uint8ClampedArray(w*h),output=new Uint8ClampedArray(w*h);for(let i=0;i&lt;input.length;i++)input[i]=data.data[i*4+3];\r\n    const r=Math.max(1,Math.round(radius\/2)),count=r*2+1;\r\n    for(let pass=0;pass&lt;2;pass++){\r\n      for(let y=0;y&lt;h;y++){let sum=0;for(let k=0;k&lt;=r&amp;&amp;k&lt;w;k++)sum+=input[y*w+k];for(let x=0;x&lt;w;x++){output[y*w+x]=sum\/count;const remove=x-r,add=x+r+1;if(remove&gt;=0)sum-=input[y*w+remove];if(add&lt;w)sum+=input[y*w+add];}}\r\n      [input,output]=[output,input];\r\n      for(let x=0;x&lt;w;x++){let sum=0;for(let k=0;k&lt;=r&amp;&amp;k&lt;h;k++)sum+=input[k*w+x];for(let y=0;y&lt;h;y++){output[y*w+x]=sum\/count;const remove=y-r,add=y+r+1;if(remove&gt;=0)sum-=input[remove*w+x];if(add&lt;h)sum+=input[add*w+x];}}\r\n      [input,output]=[output,input];\r\n    }\r\n    for(let i=0;i&lt;input.length;i++)data.data[i*4+3]=Math.round(input[i]);ctx.putImageData(data,0,0);\r\n  }\r\n  function extractSelection(canvas, selection) {\r\n    const area=selectionBounds(selection,canvas),out=createCanvas(area.width,area.height),ctx=context(out),mask=createCanvas(area.width,area.height),mctx=context(mask);\r\n    try {\r\n      mctx.translate(-area.x,-area.y);mctx.fillStyle=&#039;#fff&#039;;\r\n      const parts=selection.type===&#039;compound&#039;?selection.parts:[{op:&#039;add&#039;,selection}];\r\n      for(const part of parts){mctx.globalCompositeOperation=part.op===&#039;subtract&#039;?&#039;destination-out&#039;:&#039;source-over&#039;;selectionPath(mctx,part.selection);mctx.fill();}\r\n      mctx.setTransform(1,0,0,1,0,0);featherSelectionMask(mask,selection.feather);\r\n      ctx.drawImage(canvas,area.x,area.y,area.width,area.height,0,0,area.width,area.height);ctx.globalCompositeOperation=&#039;destination-in&#039;;ctx.drawImage(mask,0,0);ctx.globalCompositeOperation=&#039;source-over&#039;;out.selectionBounds=area;return out;\r\n    }catch(error){release(out);throw error;}finally{release(mask);}\r\n  }\r\n  \/\/ Selection pieces are independent pixel snapshots, never grid slices or references to the source image.\r\n  function exportSelection(selection) {\r\n    if (!selection || typeof selection !== &#039;object&#039;) fail(&#039;\u8bf7\u5148\u5708\u9009\u8981\u4e0b\u8f7d\u7684\u533a\u57df\u3002&#039;, &#039;empty_selection&#039;);\r\n    const finite = value =&gt; typeof value === &#039;number&#039; &amp;&amp; Number.isFinite(value);\r\n    const type = selection.type || &#039;rect&#039;, feather = clamp(number(selection.feather,0),0,24);\r\n    if(type===&#039;compound&#039;){\r\n      if(!Array.isArray(selection.parts)||!selection.parts.length||selection.parts.length&gt;24||selection.parts[0].op!==&#039;add&#039;)fail(&#039;\u7ec4\u5408\u9009\u533a\u65e0\u6548\u3002&#039;,&#039;invalid_selection&#039;);\r\n      return{type,feather,parts:selection.parts.map(part=&gt;{if(!part||![&#039;add&#039;,&#039;subtract&#039;].includes(part.op)||!part.selection||part.selection.type===&#039;compound&#039;)fail(&#039;\u7ec4\u5408\u9009\u533a\u65e0\u6548\u3002&#039;,&#039;invalid_selection&#039;);return{op:part.op,selection:exportSelection(part.selection)};})};\r\n    }\r\n    if (type === &#039;lasso&#039;) {\r\n      if (!Array.isArray(selection.points) || selection.points.length &lt; 3) fail(&#039;\u81ea\u7531\u9009\u533a\u81f3\u5c11\u9700\u89813\u4e2a\u70b9\u3002&#039;, &#039;empty_selection&#039;);\r\n      if (selection.points.length &gt; 10000 || selection.points.some(p =&gt; !p || !finite(p.x) || !finite(p.y))) fail(&#039;\u81ea\u7531\u9009\u533a\u5750\u6807\u65e0\u6548\uff0c\u8bf7\u91cd\u65b0\u5708\u9009\u3002&#039;, &#039;invalid_selection&#039;);\r\n      return { type, feather, points: selection.points.map(p =&gt; ({ x: p.x, y: p.y })) };\r\n    }\r\n    if (type !== &#039;rect&#039; &amp;&amp; type !== &#039;ellipse&#039;) fail(&#039;\u4e0d\u652f\u6301\u7684\u9009\u533a\u7c7b\u578b\u3002&#039;, &#039;invalid_selection&#039;);\r\n    if (![&#039;x&#039;, &#039;y&#039;, &#039;width&#039;, &#039;height&#039;].every(key =&gt; finite(selection[key]))) fail(&#039;\u9009\u533a\u5750\u6807\u6216\u5c3a\u5bf8\u65e0\u6548\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002&#039;, &#039;invalid_selection&#039;);\r\n    if (!selection.width || !selection.height) fail(&#039;\u9009\u533a\u6ca1\u6709\u8986\u76d6\u56fe\u7247\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002&#039;, &#039;empty_selection&#039;);\r\n    return { type, feather, x: selection.x, y: selection.y, width: selection.width, height: selection.height };\r\n  }\r\n  function selectionQueueInfo(pieces) {\r\n    if (!Array.isArray(pieces)) fail(&#039;\u5708\u9009\u5207\u7247\u5217\u8868\u65e0\u6548\u3002&#039;, &#039;invalid_selection_queue&#039;);\r\n    if (pieces.length &gt; LIMITS.maxSelectionPieces) fail(&#039;\u4e00\u6b21\u6700\u591a\u4fdd\u755930\u5757\u5708\u9009\u5207\u7247\uff0c\u8bf7\u5148\u4e0b\u8f7d\u6216\u5220\u9664\u90e8\u5206\u5207\u7247\u3002&#039;, &#039;selection_count_limit&#039;);\r\n    let pixels = 0;\r\n    for (const piece of pieces) {\r\n      const canvas = piece &amp;&amp; piece.canvas;\r\n      if (!canvas || typeof canvas.getContext !== &#039;function&#039;) fail(&#039;\u5708\u9009\u5207\u7247\u5df2\u5931\u6548\uff0c\u8bf7\u91cd\u65b0\u5708\u9009\u3002&#039;, &#039;invalid_selection_piece&#039;);\r\n      const size = validateDimensions(canvas.width, canvas.height, LIMITS.maxSelectionPixels);\r\n      pixels += size.width * size.height;\r\n      if (pixels &gt; LIMITS.maxSelectionPixels) fail(&#039;\u5708\u9009\u5207\u7247\u603b\u50cf\u7d20\u4e0d\u80fd\u8d85\u8fc71600\u4e07\uff0c\u8bf7\u5148\u4e0b\u8f7d\u6216\u5220\u9664\u90e8\u5206\u5207\u7247\u3002&#039;, &#039;selection_pixel_limit&#039;);\r\n    }\r\n    return { count: pieces.length, pixels };\r\n  }\r\n  function createSelectionPiece(canvas, selection, name, existingPieces, options) {\r\n    context(canvas); options = options || {}; const queue = selectionQueueInfo(existingPieces || []);\r\n    if (queue.count &gt;= LIMITS.maxSelectionPieces) fail(&#039;\u4e00\u6b21\u6700\u591a\u4fdd\u755930\u5757\u5708\u9009\u5207\u7247\uff0c\u8bf7\u5148\u4e0b\u8f7d\u6216\u5220\u9664\u90e8\u5206\u5207\u7247\u3002&#039;, &#039;selection_count_limit&#039;);\r\n    const selected = exportSelection(selection); const area = selectionBounds(selected, canvas);\r\n    const padding = Math.round(clamp(number(options.padding, 2), 0, 32));\r\n    const width = area.width + padding * 2, height = area.height + padding * 2;\r\n    if (queue.pixels + width * height &gt; LIMITS.maxSelectionPixels) fail(&#039;\u5708\u9009\u5207\u7247\u603b\u50cf\u7d20\u4e0d\u80fd\u8d85\u8fc71600\u4e07\uff0c\u8bf7\u5148\u4e0b\u8f7d\u6216\u5220\u9664\u90e8\u5206\u5207\u7247\u3002&#039;, &#039;selection_pixel_limit&#039;);\r\n    validateDimensions(width, height, LIMITS.maxSelectionPixels);\r\n    let extracted = null, output = null;\r\n    try {\r\n      extracted = extractSelection(canvas, selected);\r\n      if (padding) { output = createCanvas(width, height); context(output).drawImage(extracted, padding, padding); }\r\n      else { output = extracted; extracted = null; }\r\n      return { canvas: output, name: safeFilename(name || &#039;\u5708\u9009\u5207\u7247&#039;, &#039;png&#039;), bounds: { ...area }, contentBounds: { x: padding, y: padding, width: area.width, height: area.height }, padding, width, height, pixels: width * height, selection: selected, sourceSize: { width: canvas.width, height: canvas.height } };\r\n    } catch (error) { release(output); throw error; }\r\n    finally { release(extracted); }\r\n  }\r\n  async function encodeSelection(canvas, selection, options) {\r\n    const piece = createSelectionPiece(canvas, selection, &#039;\u5708\u9009\u5207\u7247&#039;, [], options);\r\n    try { return await encode(piece.canvas, { format: &#039;png&#039; }); }\r\n    finally { release(piece.canvas); }\r\n  }\r\n  async function buildSelectionZip(pieces, options) {\r\n    options = options || {}; selectionQueueInfo(pieces);\r\n    if (!pieces.length) fail(&#039;\u8bf7\u5148\u52a0\u5165\u5708\u9009\u5207\u7247\uff0c\u518d\u6253\u5305\u4e0b\u8f7d\u3002&#039;, &#039;empty_selection_queue&#039;);\r\n    if (!global.JSZip) fail(&#039;\u6253\u5305\u7ec4\u4ef6\u672a\u52a0\u8f7d\uff0c\u8bf7\u5237\u65b0\u540e\u91cd\u8bd5\u3002&#039;, &#039;zip_unavailable&#039;);\r\n    const snapshots = [], used = new Set(); const zip = new global.JSZip(); let bytes = 22;\r\n    try {\r\n      \/\/ Copy every canvas before the first await, so removing\/editing a queued piece cannot corrupt this export.\r\n      for (const piece of pieces) snapshots.push({ canvas: copy(piece.canvas), name: uniqueFilename(piece.name || &#039;\u5708\u9009\u5207\u7247-&#039; + (snapshots.length + 1), used, &#039;png&#039;) });\r\n      for (let i = 0; i &lt; snapshots.length; i++) {\r\n        const item = snapshots[i]; const blob = await encode(item.canvas, { format: &#039;png&#039; });\r\n        bytes += blob.size + 256 + item.name.length * 12;\r\n        if (bytes &gt; LIMITS.maxSelectionZipBytes) fail(&#039;\u5708\u9009\u5207\u7247\u6253\u5305\u8d85\u8fc7100MB\uff0c\u8bf7\u5206\u6279\u4e0b\u8f7d\u3002&#039;, &#039;selection_zip_limit&#039;);\r\n        zip.file(item.name, await blob.arrayBuffer());\r\n        if (options.onProgress) options.onProgress(i + 1, snapshots.length);\r\n      }\r\n      const blob = await zip.generateAsync({ type: &#039;blob&#039;, compression: &#039;STORE&#039; });\r\n      if (blob.size &gt; LIMITS.maxSelectionZipBytes) fail(&#039;\u5708\u9009\u5207\u7247\u6253\u5305\u8d85\u8fc7100MB\uff0c\u8bf7\u5206\u6279\u4e0b\u8f7d\u3002&#039;, &#039;selection_zip_limit&#039;);\r\n      return blob;\r\n    } finally { snapshots.forEach(item =&gt; release(item.canvas)); }\r\n  }\r\n  function brushPath(ctx, points, radius) {\r\n    points = (points || []).filter(p =&gt; Number.isFinite(Number(p.x)) &amp;&amp; Number.isFinite(Number(p.y)));\r\n    if (!points.length) return false;\r\n    ctx.beginPath(); ctx.lineCap = &#039;round&#039;; ctx.lineJoin = &#039;round&#039;; ctx.lineWidth = radius * 2;\r\n    if (points.length === 1) { ctx.arc(Number(points[0].x), Number(points[0].y), radius, 0, Math.PI * 2); ctx.fill(); }\r\n    else { ctx.moveTo(Number(points[0].x), Number(points[0].y)); for (let i = 1; i &lt; points.length; i++) ctx.lineTo(Number(points[i].x), Number(points[i].y)); ctx.stroke(); }\r\n    return true;\r\n  }\r\n  function brushBounds(canvas, points, radius) {\r\n    const valid = (points || []).filter(p =&gt; Number.isFinite(Number(p.x)) &amp;&amp; Number.isFinite(Number(p.y)));\r\n    if (!valid.length) return null;\r\n    const limits = valid.reduce((b, p) =&gt; { b.left = Math.min(b.left, Number(p.x)); b.right = Math.max(b.right, Number(p.x)); b.top = Math.min(b.top, Number(p.y)); b.bottom = Math.max(b.bottom, Number(p.y)); return b; }, { left: Infinity, right: -Infinity, top: Infinity, bottom: -Infinity });\r\n    const x = clamp(Math.floor(limits.left - radius - 2), 0, canvas.width), y = clamp(Math.floor(limits.top - radius - 2), 0, canvas.height);\r\n    const right = clamp(Math.ceil(limits.right + radius + 2), 0, canvas.width), bottom = clamp(Math.ceil(limits.bottom + radius + 2), 0, canvas.height);\r\n    return right &gt; x &amp;&amp; bottom &gt; y ? { x, y, width: right - x, height: bottom - y } : null;\r\n  }\r\n  \/\/ \u7528\u9884\u4e58\u900f\u660e\u5ea6\u63d2\u503c\u66ff\u6362\u9009\u533a\u50cf\u7d20\u3002\u666e\u901asource-over\u4f1a\u8ba9\u534a\u900f\u660ePNG\u8d8a\u6062\u590d\u8d8a\u4e0d\u900f\u660e\u3002\r\n  function blendMasked(canvas, source, mask, bounds, opacity) {\r\n    const ctx = context(canvas); const current = ctx.getImageData(bounds.x, bounds.y, bounds.width, bounds.height); const target = context(source).getImageData(bounds.x, bounds.y, bounds.width, bounds.height); const coverage = context(mask).getImageData(0, 0, bounds.width, bounds.height).data;\r\n    for (let i = 0; i &lt; current.data.length; i += 4) {\r\n      const amount = coverage[i + 3] \/ 255 * opacity; if (!amount) continue;\r\n      const oldAlpha = current.data[i + 3] \/ 255, newAlpha = target.data[i + 3] \/ 255, alpha = oldAlpha * (1 - amount) + newAlpha * amount;\r\n      for (let channel = 0; channel &lt; 3; channel++) current.data[i + channel] = alpha ? (current.data[i + channel] * oldAlpha * (1 - amount) + target.data[i + channel] * newAlpha * amount) \/ alpha : 0;\r\n      current.data[i + 3] = alpha * 255;\r\n    }\r\n    ctx.putImageData(current, bounds.x, bounds.y);\r\n  }\r\n  \/** \u539f\u5730\u4fee\u6539\u3002brush(canvas, baseline, points, size\u76f4\u5f84, &#039;erase&#039;|&#039;restore&#039;)\uff0c\u6216 brush(canvas, {baseline,points,radius,mode,opacity})\u3002 *\/\r\n  function brush(canvas, baselineOrOptions, points, size, mode) {\r\n    let options;\r\n    if ((baselineOrOptions &amp;&amp; typeof baselineOrOptions.getContext === &#039;function&#039;) || Array.isArray(points)) options = { baseline: baselineOrOptions, points, radius: number(size, 20) \/ 2, mode: mode || &#039;erase&#039; };\r\n    else options = baselineOrOptions || {};\r\n    const radius = clamp(number(options.radius, number(options.size, 20) \/ 2), 0.5, 512); const opacity = clamp(number(options.opacity, 1), 0, 1); const ctx = context(canvas);\r\n    if (!options.points || !options.points.length || !opacity) return canvas;\r\n    if ((options.mode || &#039;erase&#039;) === &#039;restore&#039;) {\r\n      const baseline = options.baseline; if (!baseline || baseline.width !== canvas.width || baseline.height !== canvas.height) fail(&#039;\u6062\u590d\u753b\u7b14\u9700\u8981\u76f8\u540c\u5c3a\u5bf8\u7684\u539f\u59cb\u56fe\u7247\u3002&#039;, &#039;invalid_baseline&#039;);\r\n      const bounds = brushBounds(canvas, options.points, radius); if (!bounds) return canvas;\r\n      const mask = createCanvas(bounds.width, bounds.height); const mctx = context(mask); mctx.translate(-bounds.x, -bounds.y); mctx.fillStyle = &#039;#fff&#039;; mctx.strokeStyle = &#039;#fff&#039;; brushPath(mctx, options.points, radius);\r\n      blendMasked(canvas, baseline, mask, bounds, opacity); release(mask);\r\n    } else if (options.mode === &#039;erase&#039; || !options.mode) { ctx.save(); ctx.globalAlpha = opacity; ctx.globalCompositeOperation = &#039;destination-out&#039;; ctx.fillStyle = &#039;#000&#039;; ctx.strokeStyle = &#039;#000&#039;; brushPath(ctx, options.points, radius); ctx.restore(); }\r\n    else fail(&#039;\u4e0d\u652f\u6301\u7684\u753b\u7b14\u6a21\u5f0f\u3002&#039;, &#039;invalid_brush&#039;);\r\n    return canvas;\r\n  }\r\n  function mosaic(canvas, options) {\r\n    options = options || {}; const block = Math.round(clamp(number(options.blockSize, 12), 2, 256)); const ctx = context(canvas);\r\n    const small = createCanvas(Math.max(1, Math.ceil(canvas.width \/ block)), Math.max(1, Math.ceil(canvas.height \/ block))); const sctx = context(small); sctx.imageSmoothingEnabled = true; sctx.drawImage(canvas, 0, 0, small.width, small.height);\r\n    const pixelated = createCanvas(canvas.width, canvas.height); const pctx = context(pixelated); pctx.imageSmoothingEnabled = false; pctx.drawImage(small, 0, 0, pixelated.width, pixelated.height);\r\n    const radius = clamp(number(options.radius, number(options.size, 30) \/ 2), 0.5, 512);\r\n    const bounds = options.selection ? selectionBounds(options.selection, canvas) : brushBounds(canvas, options.points, radius);\r\n    if (!bounds) { release(small); release(pixelated); if (options.points &amp;&amp; options.points.length) return canvas; fail(&#039;\u8bf7\u5148\u9009\u62e9\u9a6c\u8d5b\u514b\u533a\u57df\u3002&#039;, &#039;empty_selection&#039;); }\r\n    const mask = createCanvas(bounds.width, bounds.height); const mctx = context(mask); mctx.translate(-bounds.x, -bounds.y); mctx.fillStyle = &#039;#fff&#039;; mctx.strokeStyle = &#039;#fff&#039;;\r\n    if (options.selection) { selectionPath(mctx, options.selection); mctx.fill(); } else brushPath(mctx, options.points, radius);\r\n    blendMasked(canvas, pixelated, mask, bounds, 1); release(mask); release(small); release(pixelated); return canvas;\r\n  }\r\n\r\n  \/\/ Native retouch: bounded tiles, premultiplied-alpha blur, no model or network.\r\n  function retouchDistance(x, y, points) {\r\n    let best = Infinity;\r\n    for (let i = 0; i &lt; points.length; i++) {\r\n      const a = points[Math.max(0, i - 1)], b = points[i], dx = b.x - a.x, dy = b.y - a.y;\r\n      const t = dx || dy ? clamp(((x - a.x) * dx + (y - a.y) * dy) \/ (dx * dx + dy * dy), 0, 1) : 0;\r\n      best = Math.min(best, (x - a.x - dx * t) ** 2 + (y - a.y - dy * t) ** 2);\r\n    }\r\n    return Math.sqrt(best);\r\n  }\r\n  function retouchBoxBlur(data, width, height, radius) {\r\n    \/\/ Sliding sums keep cost independent of the blur radius. Colors are premultiplied\r\n    \/\/ during both passes, so transparent PNG edges do not acquire a dark fringe.\r\n    const tmp = new Float32Array(data.length), out = new Uint8ClampedArray(data.length), span = radius * 2 + 1;\r\n    for (let y = 0; y &lt; height; y++) {\r\n      let r = 0, g = 0, b = 0, a = 0;\r\n      const add = (x, sign) =&gt; { const i = (y * width + clamp(x, 0, width - 1)) * 4, alpha = data[i + 3]; r += data[i] * alpha * sign \/ 255; g += data[i + 1] * alpha * sign \/ 255; b += data[i + 2] * alpha * sign \/ 255; a += alpha * sign; };\r\n      for (let x = -radius; x &lt;= radius; x++) add(x, 1);\r\n      for (let x = 0; x &lt; width; x++) { const i = (y * width + x) * 4; tmp[i] = r \/ span; tmp[i + 1] = g \/ span; tmp[i + 2] = b \/ span; tmp[i + 3] = a \/ span; add(x - radius, -1); add(x + radius + 1, 1); }\r\n    }\r\n    for (let x = 0; x &lt; width; x++) {\r\n      let r = 0, g = 0, b = 0, a = 0;\r\n      const add = (y, sign) =&gt; { const i = (clamp(y, 0, height - 1) * width + x) * 4; r += tmp[i] * sign; g += tmp[i + 1] * sign; b += tmp[i + 2] * sign; a += tmp[i + 3] * sign; };\r\n      for (let y = -radius; y &lt;= radius; y++) add(y, 1);\r\n      for (let y = 0; y &lt; height; y++) { const i = (y * width + x) * 4; out[i] = a &gt; 0 ? r * 255 \/ a : 0; out[i + 1] = a &gt; 0 ? g * 255 \/ a : 0; out[i + 2] = a &gt; 0 ? b * 255 \/ a : 0; out[i + 3] = a \/ span; add(y - radius, -1); add(y + radius + 1, 1); }\r\n    }\r\n    return out;\r\n  }\r\n  function retouchBrush(canvas, options) {\r\n    options = options || {};\r\n    const mode = options.mode || &#039;paint&#039;;\r\n    if (![&#039;paint&#039;, &#039;blur&#039;, &#039;erase&#039;, &#039;restore&#039;].includes(mode)) fail(&#039;\u4e0d\u652f\u6301\u7684\u4fee\u56fe\u753b\u7b14\u3002&#039;, &#039;invalid_brush&#039;);\r\n    const radius = clamp(number(options.radius, number(options.size, 40) \/ 2), 1, 250), strength = clamp(number(options.strength, 1), 0, 1), softness = clamp(number(options.softness, 0), 0, 1);\r\n    const points = (options.points || []).slice(0, 256).filter(p =&gt; Number.isFinite(Number(p.x)) &amp;&amp; Number.isFinite(Number(p.y))).map(p =&gt; ({ x: Number(p.x), y: Number(p.y) }));\r\n    if (!points.length || !strength) return canvas;\r\n    if ((mode === &#039;erase&#039; || mode === &#039;restore&#039;) &amp;&amp; !softness) return brush(canvas, { mode, points, radius, opacity: strength, baseline: options.baseline });\r\n    if (mode === &#039;restore&#039; &amp;&amp; (!options.baseline || options.baseline.width !== canvas.width || options.baseline.height !== canvas.height)) fail(&#039;\u6062\u590d\u753b\u7b14\u9700\u8981\u76f8\u540c\u5c3a\u5bf8\u7684\u539f\u59cb\u56fe\u7247\u3002&#039;, &#039;invalid_baseline&#039;);\r\n    const color = String(options.color || &#039;#2468eb&#039;);\r\n    if (mode === &#039;paint&#039; &amp;&amp; !\/^#[0-9a-f]{6}$\/i.test(color)) fail(&#039;\u8bf7\u9009\u62e9\u6709\u6548\u7684\u753b\u7b14\u989c\u8272\u3002&#039;, &#039;invalid_color&#039;);\r\n    const rgb = [1, 3, 5].map(i =&gt; parseInt(color.slice(i, i + 2), 16)), blurRadius = Math.round(clamp(number(options.blurRadius, 8), 1, 24));\r\n    const bounds = brushBounds(canvas, points, radius); if (!bounds) return canvas;\r\n    const ctx = context(canvas), baseline = mode === &#039;restore&#039; ? context(options.baseline) : null, patches = [], tileSize = 128;\r\n    \/\/ Each read is at most 176 x 176 pixels (128 tile + 24-pixel blur halo).\r\n    \/\/ Delay writes until all tiles are sampled to prevent seams at tile boundaries.\r\n    for (let y = bounds.y; y &lt; bounds.y + bounds.height; y += tileSize) for (let x = bounds.x; x &lt; bounds.x + bounds.width; x += tileSize) {\r\n      const width = Math.min(tileSize, bounds.x + bounds.width - x), height = Math.min(tileSize, bounds.y + bounds.height - y);\r\n      if (retouchDistance(x + width \/ 2, y + height \/ 2, points) &gt; radius + Math.hypot(width, height) \/ 2 + 1) continue;\r\n      const current = ctx.getImageData(x, y, width, height), target = baseline ? baseline.getImageData(x, y, width, height).data : null;\r\n      let blurred, bx = 0, by = 0, bw = 0;\r\n      if (mode === &#039;blur&#039;) {\r\n        bx = Math.max(0, x - blurRadius); by = Math.max(0, y - blurRadius); bw = Math.min(canvas.width, x + width + blurRadius) - bx;\r\n        const bh = Math.min(canvas.height, y + height + blurRadius) - by;\r\n        blurred = retouchBoxBlur(ctx.getImageData(bx, by, bw, bh).data, bw, bh, blurRadius);\r\n      }\r\n      for (let py = 0; py &lt; height; py++) for (let px = 0; px &lt; width; px++) {\r\n        const distance = retouchDistance(x + px + .5, y + py + .5, points), i = (py * width + px) * 4;\r\n        const edge = softness ? clamp((radius - distance) \/ (radius * softness), 0, 1) : clamp(radius + .5 - distance, 0, 1);\r\n        const amount = (softness ? edge * edge * (3 - 2 * edge) : edge) * strength; if (!amount) continue;\r\n        const oldAlpha = current.data[i + 3] \/ 255;\r\n        if (mode === &#039;erase&#039;) { current.data[i + 3] *= 1 - amount; if (!current.data[i + 3]) current.data[i] = current.data[i + 1] = current.data[i + 2] = 0; continue; }\r\n        const ti = blurred ? ((y + py - by) * bw + x + px - bx) * 4 : i, source = blurred || target;\r\n        const newAlpha = mode === &#039;paint&#039; ? 1 : source[ti + 3] \/ 255;\r\n        const alpha = oldAlpha * (1 - amount) + newAlpha * amount;\r\n        for (let c = 0; c &lt; 3; c++) current.data[i + c] = alpha ? (current.data[i + c] * oldAlpha * (1 - amount) + (mode === &#039;paint&#039; ? rgb[c] : source[ti + c]) * newAlpha * amount) \/ alpha : 0;\r\n        current.data[i + 3] = alpha * 255;\r\n      }\r\n      patches.push({ x, y, current });\r\n    }\r\n    patches.forEach(p =&gt; ctx.putImageData(p.current, p.x, p.y));\r\n    return canvas;\r\n  }\r\n\r\n  function layerStyle(layer) {\r\n    const stroke = layer.stroke || {}; const shadow = layer.shadow || {};\r\n    return {\r\n      strokeColor: layer.strokeColor || stroke.color || &#039;#ffffff&#039;, strokeWidth: Math.max(0, number(layer.strokeWidth, number(stroke.width, 0))),\r\n      shadowColor: layer.shadowColor || shadow.color || &#039;rgba(0,0,0,.3)&#039;, shadowBlur: Math.max(0, number(layer.shadowBlur, number(shadow.blur, 0))),\r\n      shadowOffsetX: number(layer.shadowOffsetX, number(shadow.x, 0)), shadowOffsetY: number(layer.shadowOffsetY, number(shadow.y, 0))\r\n    };\r\n  }\r\n  function outlineImage(ctx, image, width, height, color, strokeWidth) {\r\n    if (!strokeWidth) return;\r\n    const tint = createCanvas(image.width, image.height); const tctx = context(tint); tctx.drawImage(image, 0, 0); tctx.globalCompositeOperation = &#039;source-in&#039;; tctx.fillStyle = color; tctx.fillRect(0, 0, tint.width, tint.height);\r\n    const count = Math.min(48, Math.max(12, Math.ceil(strokeWidth * 2)));\r\n    for (let i = 0; i &lt; count; i++) { const a = Math.PI * 2 * i \/ count; ctx.drawImage(tint, -width \/ 2 + Math.cos(a) * strokeWidth, -height \/ 2 + Math.sin(a) * strokeWidth, width, height); }\r\n    release(tint);\r\n  }\r\n  function wrapText(ctx, text, width) {\r\n    const result = [];\r\n    String(text || &#039;&#039;).split(\/\\r?\\n\/).forEach(paragraph =&gt; {\r\n      if (!paragraph) { result.push(&#039;&#039;); return; } let line = &#039;&#039;;\r\n      \/\/ \u6309Unicode\u5b57\u7b26\u6362\u884c\uff0c\u907f\u514d\u4e2d\u6587\u957f\u53e5\u6ea2\u51fa\uff1b\u4e0d\u5207\u5f00\u4ee3\u7406\u5bf9\u3002\r\n      Array.from(paragraph).forEach(character =&gt; { const next = line + character; if (line &amp;&amp; ctx.measureText(next).width &gt; width) { result.push(line); line = character; } else line = next; }); result.push(line);\r\n    }); return result;\r\n  }\r\n  function imageFrameGeometry(imageWidth,imageHeight,width,height,frame) {\r\n    const fit=frame&amp;&amp;frame.fit===&#039;contain&#039;?&#039;contain&#039;:&#039;cover&#039;,zoom=clamp(number(frame&amp;&amp;frame.zoom,1),1,3),offsetX=clamp(number(frame&amp;&amp;frame.offsetX,.5),0,1),offsetY=clamp(number(frame&amp;&amp;frame.offsetY,.5),0,1);\r\n    const scale=(fit===&#039;contain&#039;?Math.min(width\/imageWidth,height\/imageHeight):Math.max(width\/imageWidth,height\/imageHeight))*zoom,dw=imageWidth*scale,dh=imageHeight*scale;\r\n    return{x:-width\/2+(width-dw)*offsetX,y:-height\/2+(height-dh)*offsetY,width:dw,height:dh,radius:Math.min(width\/2,height\/2,clamp(number(frame&amp;&amp;frame.radius,0),0,200))};\r\n  }\r\n  function imageFramePath(ctx,width,height,radius){const x=-width\/2,y=-height\/2,w=width,h=height,r=radius;ctx.beginPath();ctx.moveTo(x+r,y);ctx.lineTo(x+w-r,y);ctx.quadraticCurveTo(x+w,y,x+w,y+r);ctx.lineTo(x+w,y+h-r);ctx.quadraticCurveTo(x+w,y+h,x+w-r,y+h);ctx.lineTo(x+r,y+h);ctx.quadraticCurveTo(x,y+h,x,y+h-r);ctx.lineTo(x,y+r);ctx.quadraticCurveTo(x,y,x+r,y);ctx.closePath();}\r\n  function renderScene(scene, options) {\r\n    if (!scene) fail(&#039;\u672a\u627e\u5230\u7f16\u8f91\u753b\u5e03\u3002&#039;); options = options || {};\r\n    const actual = validateDimensions(scene.width, scene.height, LIMITS.maxScenePixels); const scale = clamp(number(options.scale, 1), 0.02, 1);\r\n    const out = createCanvas(Math.max(1, Math.round(actual.width * scale)), Math.max(1, Math.round(actual.height * scale)), { maxPixels: LIMITS.maxScenePixels }); const ctx = context(out); ctx.scale(scale, scale);\r\n    if (scene.background &amp;&amp; scene.background !== &#039;transparent&#039;) { ctx.fillStyle = scene.background; ctx.fillRect(0, 0, actual.width, actual.height); }\r\n    (scene.layers || []).forEach(layer =&gt; {\r\n      if (!layer || layer.visible === false) return;\r\n      const image = layer.canvas || layer.image; const width = Math.max(1, number(layer.width, image ? image.width : actual.width)); const height = Math.max(1, number(layer.height, image ? image.height : number(layer.fontSize, 48) * 1.4));\r\n      const style = layerStyle(layer); ctx.save(); ctx.globalAlpha = clamp(number(layer.opacity, 1), 0, 1); ctx.translate(number(layer.x, 0) + width \/ 2, number(layer.y, 0) + height \/ 2); ctx.rotate(number(layer.rotation, 0) * Math.PI \/ 180);\r\n      ctx.shadowColor = style.shadowColor; ctx.shadowBlur = style.shadowBlur; ctx.shadowOffsetX = style.shadowOffsetX; ctx.shadowOffsetY = style.shadowOffsetY;\r\n      if (layer.type === &#039;text&#039;) {\r\n        const fontSize = clamp(number(layer.fontSize, 48), 1, 2048); const fontFamily = String(layer.fontFamily || &#039;sans-serif&#039;).replace(\/[;\\n\\r]\/g, &#039;&#039;);\r\n        ctx.font = String(layer.fontWeight || (layer.bold ? &#039;bold&#039; : &#039;normal&#039;)) + &#039; &#039; + fontSize + &#039;px &#039; + fontFamily; ctx.textBaseline = &#039;top&#039;; const align = layer.align || layer.textAlign || &#039;left&#039;; ctx.textAlign = [&#039;left&#039;, &#039;center&#039;, &#039;right&#039;].includes(align) ? align : &#039;left&#039;;\r\n        const lines = wrapText(ctx, layer.text, width); const lineHeight = Math.max(0.5, number(layer.lineHeight, 1.3)) * fontSize; const textX = ctx.textAlign === &#039;center&#039; ? 0 : ctx.textAlign === &#039;right&#039; ? width \/ 2 : -width \/ 2;\r\n        ctx.fillStyle = layer.color || &#039;#222222&#039;; ctx.strokeStyle = style.strokeColor; ctx.lineWidth = style.strokeWidth * 2; ctx.lineJoin = &#039;round&#039;;\r\n        lines.forEach((line, i) =&gt; { const y = -height \/ 2 + i * lineHeight; if (style.strokeWidth) ctx.strokeText(line, textX, y); ctx.fillText(line, textX, y); });\r\n      } else if (layer.type === &#039;shape&#039;) {\r\n        const x=-width\/2,y=-height\/2,w=width,h=height,r=Math.min(w,h)*.16;\r\n        ctx.beginPath();\r\n        if(layer.shape===&#039;ellipse&#039;)ctx.ellipse(0,0,w\/2,h\/2,0,0,Math.PI*2);\r\n        else if(layer.shape===&#039;triangle&#039;){ctx.moveTo(0,y);ctx.lineTo(x+w,y+h);ctx.lineTo(x,y+h);ctx.closePath();}\r\n        else if(layer.shape===&#039;line&#039;||layer.shape===&#039;arrow&#039;){ctx.moveTo(x,0);ctx.lineTo(x+w,0);if(layer.shape===&#039;arrow&#039;){const a=Math.min(w*.3,h*.8);ctx.moveTo(x+w-a,-a\/2);ctx.lineTo(x+w,0);ctx.lineTo(x+w-a,a\/2);}}\r\n        else if(layer.shape===&#039;roundrect&#039;){ctx.moveTo(x+r,y);ctx.lineTo(x+w-r,y);ctx.quadraticCurveTo(x+w,y,x+w,y+r);ctx.lineTo(x+w,y+h-r);ctx.quadraticCurveTo(x+w,y+h,x+w-r,y+h);ctx.lineTo(x+r,y+h);ctx.quadraticCurveTo(x,y+h,x,y+h-r);ctx.lineTo(x,y+r);ctx.quadraticCurveTo(x,y,x+r,y);ctx.closePath();}\r\n        else ctx.rect(x,y,w,h);\r\n        ctx.fillStyle=layer.color||&#039;#2468eb&#039;;ctx.strokeStyle=style.strokeColor;ctx.lineWidth=style.strokeWidth;ctx.lineJoin=&#039;round&#039;;ctx.lineCap=&#039;round&#039;;\r\n        if(!layer.noFill&amp;&amp;![&#039;line&#039;,&#039;arrow&#039;].includes(layer.shape))ctx.fill();\r\n        if(style.strokeWidth&gt;0)ctx.stroke();\r\n      } else if (layer.type === &#039;image&#039; &amp;&amp; image) {\r\n        if(layer.frameCrop&amp;&amp;typeof layer.frameCrop===&#039;object&#039;){\r\n          const frame=imageFrameGeometry(image.width,image.height,width,height,layer.frameCrop);\r\n          ctx.save();imageFramePath(ctx,width,height,frame.radius);ctx.clip();ctx.drawImage(image,frame.x,frame.y,frame.width,frame.height);ctx.restore();\r\n          if(style.strokeWidth&gt;0){imageFramePath(ctx,width,height,frame.radius);ctx.strokeStyle=style.strokeColor;ctx.lineWidth=style.strokeWidth;ctx.stroke();}\r\n        }else{outlineImage(ctx, image, width, height, style.strokeColor, Math.min(100, style.strokeWidth)); ctx.drawImage(image, -width \/ 2, -height \/ 2, width, height);}\r\n      }\r\n      ctx.restore();\r\n    });\r\n    return out;\r\n  }\r\n  function splitGrid(canvas, rows, columns, options) {\r\n    if (typeof rows === &#039;object&#039;) { options = rows; columns = rows.columns || rows.cols; rows = rows.rows; } options = options || {};\r\n    rows = Math.round(clamp(number(rows, 1), 1, 20)); columns = Math.round(clamp(number(columns, 1), 1, 20));\r\n    if (rows &gt; canvas.height || columns &gt; canvas.width) fail(&#039;\u5207\u56fe\u884c\u5217\u6570\u4e0d\u80fd\u8d85\u8fc7\u56fe\u7247\u7684\u50cf\u7d20\u5c3a\u5bf8\u3002&#039;, &#039;invalid_grid&#039;);\r\n    if (rows * columns &gt; 100) fail(&#039;\u4e00\u6b21\u6700\u591a\u5207\u6210100\u5f20\u56fe\u7247\u3002&#039;, &#039;grid_limit&#039;);\r\n    const parts = [];\r\n    for (let row = 0; row &lt; rows; row++) for (let column = 0; column &lt; columns; column++) {\r\n      const left = Math.floor(column * canvas.width \/ columns), right = Math.floor((column + 1) * canvas.width \/ columns), top = Math.floor(row * canvas.height \/ rows), bottom = Math.floor((row + 1) * canvas.height \/ rows);\r\n      const part = crop(canvas, { x: left, y: top, width: right - left, height: bottom - top }); part.gridInfo = { row, column, x: left, y: top }; parts.push(part);\r\n    }\r\n    return parts;\r\n  }\r\n  async function encode(canvas, options) {\r\n    options = options || {}; const format = String(options.format || &#039;png&#039;).toLowerCase().replace(&#039;jpg&#039;, &#039;jpeg&#039;);\r\n    if (!MIME[format]) fail(&#039;\u8bf7\u9009\u62e9PNG\u3001JPG\u6216WebP\u5bfc\u51fa\u3002&#039;, &#039;unsupported_format&#039;);\r\n    validateDimensions(canvas.width, canvas.height); let encodedCanvas = canvas;\r\n    if (format === &#039;jpeg&#039;) { encodedCanvas = createCanvas(canvas.width, canvas.height); const ctx = context(encodedCanvas); ctx.fillStyle = options.background || &#039;#ffffff&#039;; ctx.fillRect(0, 0, canvas.width, canvas.height); ctx.drawImage(canvas, 0, 0); }\r\n    try {\r\n      const blob = await new Promise((resolve, reject) =&gt; { try { encodedCanvas.toBlob(value =&gt; value ? resolve(value) : reject(new Error(&#039;\u5bfc\u51fa\u5931\u8d25\uff0c\u8bf7\u51cf\u5c0f\u56fe\u7247\u5c3a\u5bf8\u91cd\u8bd5\u3002&#039;)), MIME[format], clamp(number(options.quality, 0.92), 0.01, 1)); } catch (error) { reject(error); } });\r\n      if (blob.type !== MIME[format]) fail(&#039;\u6b64\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u6240\u9009\u5bfc\u51fa\u683c\u5f0f\uff0c\u8bf7\u6539\u7528PNG\u6216JPG\u3002&#039;, &#039;encode_unsupported&#039;);\r\n      return blob;\r\n    } catch (error) { if (error.code) throw error; fail(&#039;\u5bfc\u51fa\u5931\u8d25\uff0c\u8bf7\u51cf\u5c0f\u56fe\u7247\u5c3a\u5bf8\u91cd\u8bd5\u3002&#039;, &#039;encode_failed&#039;); }\r\n    finally { if (encodedCanvas !== canvas) release(encodedCanvas); }\r\n  }\r\n  function safeFilename(name, extension) {\r\n    let clean = String(name || &#039;\u56fe\u7247&#039;).normalize(&#039;NFC&#039;).replace(\/[\\u0000-\\u001f\\u007f&lt;&gt;:&quot;\/\\\\|?*]\/g, &#039;_&#039;).replace(\/^\\.+|[.\\s]+$\/g, &#039;&#039;).trim();\r\n    if (!clean) clean = &#039;\u56fe\u7247&#039;; clean = Array.from(clean).slice(0, 120).join(&#039;&#039;);\r\n    if (\/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\.|$)\/i.test(clean)) clean = &#039;_&#039; + clean;\r\n    if (extension) { clean = clean.replace(\/\\.(?:png|jpe?g|webp)$\/i, &#039;&#039;); clean += &#039;.&#039; + String(extension).replace(\/^\\.\/, &#039;&#039;).replace(\/[^a-z0-9]\/gi, &#039;&#039;).toLowerCase(); }\r\n    return clean;\r\n  }\r\n  function uniqueFilename(name, used, extension) {\r\n    const base = safeFilename(name, extension); const names = used || new Set(); const exists = value =&gt; names instanceof Set ? names.has(value.toLocaleLowerCase()) || names.has(value) : Object.prototype.hasOwnProperty.call(names, value.toLocaleLowerCase());\r\n    const match = base.match(\/^(.*?)(\\.[a-z0-9]{1,8})$\/i); const stem = match ? match[1] : base, suffix = match ? match[2] : &#039;&#039;; let candidate = base; let index = 2;\r\n    while (exists(candidate)) candidate = stem + &#039;-&#039; + index++ + suffix;\r\n    if (names instanceof Set) names.add(candidate.toLocaleLowerCase()); else names[candidate.toLocaleLowerCase()] = true;\r\n    return candidate;\r\n  }\r\n  async function buildZip(items, options) {\r\n    if (!global.JSZip) fail(&#039;\u6253\u5305\u7ec4\u4ef6\u672a\u52a0\u8f7d\uff0c\u8bf7\u5237\u65b0\u540e\u91cd\u8bd5\u3002&#039;, &#039;zip_unavailable&#039;); options = options || {}; const zip = new global.JSZip(); const used = new Set();\r\n    const list = Array.from(items || []); if (!list.length) fail(&#039;\u6ca1\u6709\u53ef\u6253\u5305\u7684\u56fe\u7247\u3002&#039;, &#039;empty_batch&#039;); if (list.length &gt; 100) fail(&#039;\u4e00\u6b21\u6700\u591a\u6253\u5305100\u5f20\u56fe\u7247\u3002&#039;, &#039;batch_limit&#039;);\r\n    const format = String(options.format || &#039;png&#039;).replace(&#039;jpg&#039;, &#039;jpeg&#039;); const extension = format === &#039;jpeg&#039; ? &#039;jpg&#039; : format;\r\n    for (let i = 0; i &lt; list.length; i++) { const item = list[i]; const canvas = item.canvas || (typeof item.getContext === &#039;function&#039; ? item : null); const blob = item.blob || (canvas &amp;&amp; await encode(canvas, options)); if (!(blob instanceof Blob)) fail(&#039;\u6253\u5305\u56fe\u7247\u65e0\u6548\u3002&#039;); const name = uniqueFilename(item.name || &#039;\u56fe\u7247-&#039; + (i + 1), used, extension); zip.file(name, await blob.arrayBuffer()); if (options.onProgress) options.onProgress(i + 1, list.length); }\r\n    return zip.generateAsync({ type: &#039;blob&#039;, compression: &#039;STORE&#039; });\r\n  }\r\n\r\n  global.ShandeImageCore = Object.freeze({ LIMITS, MIME, createCanvas, copy, clone: copy, clearCanvas, release, inspectFile, loadFile, loadFiles, validateDimensions, adjust, transform, resize, crop, normalizeRect, trimTransparent, selectionBounds, selectionPath, extractSelection, extract: extractSelection, selectionQueueInfo, createSelectionPiece, encodeSelection, buildSelectionZip, brush, mosaic, imageFrameGeometry, retouchBrush, renderScene, splitGrid, encode, safeFilename, filename: safeFilename, uniqueFilename, buildZip, zip: buildZip, wrapText });\r\n})(window);\r\n&lt;\/script&gt;&lt;script&gt;(function(){\r\n&#039;use strict&#039;;\r\nconst C=window.ShandeImageCore,$=id=&gt;document.getElementById(id),MAX_SCENE=16000000,MAX_IMAGES=20,MAX_ASSET_PIXELS=32000000;\r\nif(!C){$(&#039;notice&#039;).hidden=false;$(&#039;notice&#039;).textContent=&#039;\u56fe\u7247\u7f16\u8f91\u7ec4\u4ef6\u8bfb\u53d6\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u9875\u9762\u3002&#039;;$(&#039;notice&#039;).classList.add(&#039;error&#039;);return;}\r\nconst scene={width:1200,height:1200,background:null,canvasFixed:false,layers:[]};\r\nlet selected=null,tool=&#039;lasso&#039;,selection=null,drag=null,preview=null,previewScale=1,busy=false,nextId=1,history=[],future=[],downloads=[],adjusted=null;\r\nlet comparingOriginal=false,dirty=false,editRevision=0;\r\nconst PROJECT_SCHEMA=3;\r\nlet projectName=&#039;\u672a\u547d\u540d\u8bbe\u8ba1&#039;,projectId=makeProjectId(),projectCreatedAt=Date.now();\r\nfunction makeProjectId(){return &#039;p_&#039;+(globalThis.crypto?.randomUUID?.()||Date.now().toString(36)+&#039;_&#039;+Math.random().toString(36).slice(2));}\r\nfunction cleanProjectName(value){return String(value||&#039;\u672a\u547d\u540d\u8bbe\u8ba1&#039;).replace(\/[\\u0000-\\u001f\\u007f]\/g,&#039;&#039;).trim().slice(0,80)||&#039;\u672a\u547d\u540d\u8bbe\u8ba1&#039;;}\r\nfunction setProjectName(value){projectName=cleanProjectName(value);$(&#039;projectName&#039;).value=projectName;}\r\nfunction resetProjectIdentity(name=&#039;\u672a\u547d\u540d\u8bbe\u8ba1&#039;){setProjectName(name);projectId=makeProjectId();projectCreatedAt=Date.now();}\r\nlet autoDraftTimer=null,draftChecked=false,draftPending=false,draftToken=null,draftInspectPromise=null,draftWriting=false,autoDraftPaused=false,draftCheckedScope=&#039;&#039;;\r\nlet exportPreviewTimer=null,exportPreviewSerial=0,exportPreviewURL=null,exportCached=null,exportPreviewBusy=false,exportPreviewAgain=false;\r\n\r\nlet workspaceMode=&#039;edit&#039;,selectionTool=&#039;lasso&#039;,cutQueue=[],cutFuture=[],nextCutId=1,lastSelectionQueued=false,lastQueuedCutId=null,zoomLevel=null;\r\nconst cloneCanvas=canvas=&gt;{const out=C.createCanvas(canvas.width,canvas.height);out.getContext(&#039;2d&#039;).drawImage(canvas,0,0);return out;};\r\nfunction setProjectStatus(text){$(&#039;projectStatus&#039;).textContent=text;}\r\nfunction setDirty(value){dirty=!!value&amp;&amp;creativeBoot.mode!==&#039;trial&#039;;if(typeof reportHostDirty===&#039;function&#039;)reportHostDirty();}\r\nfunction markChanged(){editRevision++;setDirty(true);setProjectStatus(&#039;\u6709\u672a\u4fdd\u5b58\u7684\u66f4\u6539&#039;);scheduleAutoDraft();invalidateExportPreview();}\r\nwindow.addEventListener(&#039;beforeunload&#039;,event=&gt;{if(dirty){event.preventDefault();event.returnValue=&#039;&#039;;}});\r\nfunction confirmProjectReplacement(){if(!dirty)return Promise.resolve(true);const dialog=$(&#039;replaceProjectDialog&#039;);return new Promise(resolve=&gt;{dialog.returnValue=&#039;cancel&#039;;const close=()=&gt;{dialog.removeEventListener(&#039;close&#039;,close);resolve(dialog.returnValue===&#039;replace&#039;);};dialog.addEventListener(&#039;close&#039;,close);dialog.showModal();});}\r\nfunction show(message,error=false){$(&#039;notice&#039;).hidden=!message;$(&#039;notice&#039;).textContent=message||&#039;&#039;;$(&#039;notice&#039;).classList.toggle(&#039;error&#039;,error);}\r\nfunction active(){return scene.layers.find(l=&gt;l.id===selected);}\r\nfunction imageLayer(){const l=active();if(!l||l.type!==&#039;image&#039;)throw Error(&#039;\u8bf7\u5148\u5728\u201c\u56fe\u5c42\u4e0e\u539f\u56fe\u201d\u4e2d\u9009\u4e2d\u4e00\u5f20\u56fe\u7247\u3002&#039;);return l;}\r\nfunction pixelCount(){return scene.layers.filter(l=&gt;l.type===&#039;image&#039;).reduce((n,l)=&gt;n+l.image.width*l.image.height,0);}\r\nfunction guardSize(w,h){w=Math.round(Number(w));h=Math.round(Number(h));if(!Number.isFinite(w)||!Number.isFinite(h)||w&lt;1||h&lt;1||w&gt;8192||h&gt;8192||w*h&gt;MAX_SCENE)throw Error(&#039;\u753b\u5e03\u6700\u5927\u8fb9\u957f8192\u50cf\u7d20\uff0c\u603b\u50cf\u7d20\u4e0d\u8d85\u8fc71600\u4e07\u3002&#039;);return{w,h};}\r\nfunction snapshot(){return {width:scene.width,height:scene.height,background:scene.background,canvasFixed:scene.canvasFixed,selected,layers:scene.layers.map(l=&gt;{const a={...l};if(l.type===&#039;image&#039;){a.image=cloneCanvas(l.image);a.canvas=a.image;a.baseline=l.baseline;a.original=l.original;}return a;})};}\r\nfunction historyPixels(s){return s.layers.filter(l=&gt;l.type===&#039;image&#039;).reduce((n,l)=&gt;n+l.image.width*l.image.height,0);}\r\nfunction pushHistory(){markChanged();history.push(snapshot());future=[];let pixels=history.reduce((n,s)=&gt;n+historyPixels(s),0);while(history.length&gt;1&amp;&amp;(history.length&gt;12||pixels&gt;48000000)){pixels-=historyPixels(history.shift());}updateHistory();}\r\nfunction restore(s){markChanged();Object.assign(scene,{width:s.width,height:s.height,background:s.background,canvasFixed:!!s.canvasFixed,layers:s.layers});selected=s.selected;normalizeCanvasSelection(true);selection=null;adjusted=null;resetAdjust(false);renderLayers();syncInspector();draw();updateHistory();}\r\nfunction updateHistory(){$(&#039;undo&#039;).disabled=workspaceMode===&#039;selection&#039;?!cutQueue.length&amp;&amp;!history.length:!history.length;$(&#039;redo&#039;).disabled=workspaceMode===&#039;selection&#039;?!cutFuture.length&amp;&amp;!future.length:!future.length;}\r\nfunction undo(){if(busy)return;if(workspaceMode===&#039;selection&#039;&amp;&amp;cutQueue.length){undoCut();return;}if(!history.length)return;future.push(snapshot());restore(history.pop());show(&#039;\u5df2\u64a4\u9500\u3002&#039;);}\r\nfunction redo(){if(busy)return;if(workspaceMode===&#039;selection&#039;&amp;&amp;cutFuture.length){redoCut();return;}if(!future.length)return;history.push(snapshot());restore(future.pop());show(&#039;\u5df2\u91cd\u505a\u3002&#039;);}\r\nfunction download(blob,name){if(hostDownload(blob,name))return;const url=URL.createObjectURL(blob);downloads.forEach(old=&gt;URL.revokeObjectURL(old));downloads=[url];const box=$(&#039;downloads&#039;);box.hidden=false;box.replaceChildren();const p=document.createElement(&#039;p&#039;);p.textContent=&#039;\u6587\u4ef6\u5df2\u51c6\u5907\u597d\u3002\u5982\u679c\u6d4f\u89c8\u5668\u6ca1\u6709\u81ea\u52a8\u4e0b\u8f7d\uff0c\u70b9\u51fb\u4e0b\u65b9\u94fe\u63a5\uff1a&#039;;const link=document.createElement(&#039;a&#039;);link.href=url;link.download=name;link.textContent=&#039;\u4e0b\u8f7d &#039;+name;box.append(p,link);link.click();}\r\nasync function run(fn){if(busy)return;busy=true;reportHostBusy();document.body.classList.add(&#039;busy&#039;);try{await fn();}catch(e){show(e.message||String(e),true);}finally{busy=false;reportHostBusy();document.body.classList.remove(&#039;busy&#039;);draw();}}\r\nfunction makeImage(image,name){const originals=cloneCanvas(image);return{id:nextId++,type:&#039;image&#039;,name:name||&#039;\u56fe\u7247&#039;,image,canvas:image,baseline:cloneCanvas(image),original:originals,x:0,y:0,width:image.width,height:image.height,rotation:0,opacity:1,visible:true,strokeWidth:0,strokeColor:&#039;#ffffff&#039;,shadowBlur:0,shadowColor:&#039;#000000&#039;,shadowOffsetX:0,shadowOffsetY:0};}\r\nasync function importFiles(files){if(!await requireAccess(&#039;import&#039;))return;await run(async()=&gt;{const list=Array.from(files||[]);if(!list.length)return;if((hasLoadedExample?0:scene.layers.length)+list.length&gt;50)throw Error(&#039;\u9879\u76ee\u6700\u591a50\u4e2a\u56fe\u5c42\u3002&#039;);if((hasLoadedExample?0:scene.layers.filter(l=&gt;l.type===&#039;image&#039;).length)+list.length&gt;MAX_IMAGES)throw Error(&#039;\u4e00\u4e2a\u9879\u76ee\u6700\u591a\u6dfb\u52a020\u5f20\u56fe\u7247\uff0c\u8bf7\u5206\u6279\u5904\u7406\u3002&#039;);let pixelTotal=hasLoadedExample?0:pixelCount();const loaded=[];for(const f of list){const img=await C.loadFile(f);const canvas=img.canvas||img;pixelTotal+=canvas.width*canvas.height;if(pixelTotal&gt;MAX_ASSET_PIXELS)throw Error(&#039;\u5168\u90e8\u56fe\u7247\u603b\u50cf\u7d20\u4e0d\u80fd\u8d85\u8fc73200\u4e07\uff0c\u8bf7\u5148\u7f29\u5c0f\u56fe\u7247\u6216\u5206\u6279\u5904\u7406\u3002&#039;);loaded.push(makeImage(canvas,f.name.replace(\/\\.[^.]+$\/,&#039;&#039;)));}pushHistory();if(hasLoadedExample){scene.layers=[];releaseCuts();renderCuts();hasLoadedExample=false;}if(!scene.layers.length&amp;&amp;!scene.canvasFixed){const first=loaded[0],ratio=Math.min(1,Math.sqrt(MAX_SCENE\/(first.width*first.height)));scene.width=Math.round(first.width*ratio);scene.height=Math.round(first.height*ratio);}loaded.forEach(l=&gt;{const r=Math.min(1,scene.width\/l.width,scene.height\/l.height);l.width=Math.round(l.width*r);l.height=Math.round(l.height*r);l.x=(scene.width-l.width)\/2;l.y=(scene.height-l.height)\/2;scene.layers.push(l);});selected=loaded[loaded.length-1].id;selection=null;resetAdjust(false);renderLayers();syncInspector();draw();show(&#039;\u5df2\u6dfb\u52a0&#039;+loaded.length+&#039;\u5f20\u56fe\u7247\u3002\u9009\u4e2d\u56fe\u5c42\u540e\u53ef\u5f00\u59cb\u7f16\u8f91\u3002&#039;);});$(&#039;fileInput&#039;).value=&#039;&#039;;}\r\nfunction renderLayers(){\r\n  const list=normalizeCanvasSelection(),box=$(&#039;layers&#039;);$(&#039;layerCount&#039;).textContent=String(scene.layers.length);box.replaceChildren();\r\n  if(!scene.layers.length){const empty=document.createElement(&#039;div&#039;);empty.className=&#039;empty-list&#039;;empty.textContent=&#039;\u8fd8\u6ca1\u6709\u56fe\u5c42\uff0c\u53ef\u6dfb\u52a0\u56fe\u7247\u3001\u6587\u5b57\u6216\u5f62\u72b6\u3002&#039;;box.append(empty);return;}\r\n  [...scene.layers].reverse().forEach(l=&gt;{\r\n    const item=document.createElement(&#039;div&#039;);item.className=&#039;layer-card&#039;+(selectedIds.has(l.id)?&#039; selected&#039;:&#039;&#039;)+(l.locked?&#039; locked&#039;:&#039;&#039;);item.dataset.layerId=String(l.id);item.tabIndex=0;item.setAttribute(&#039;role&#039;,&#039;option&#039;);item.setAttribute(&#039;aria-selected&#039;,String(selectedIds.has(l.id)));item.setAttribute(&#039;aria-label&#039;,&#039;\u9009\u62e9\u56fe\u5c42 &#039;+l.name);item.draggable=!l.locked;\r\n    const thumb=document.createElement(&#039;canvas&#039;);thumb.className=&#039;layer-thumb&#039;;thumb.width=thumb.height=60;const ctx=thumb.getContext(&#039;2d&#039;);if(l.type===&#039;image&#039;){const r=Math.min(60\/l.image.width,60\/l.image.height);ctx.drawImage(l.image,(60-l.image.width*r)\/2,(60-l.image.height*r)\/2,l.image.width*r,l.image.height*r);}else{ctx.fillStyle=l.color;ctx.font=&#039;bold 28px sans-serif&#039;;ctx.textAlign=&#039;center&#039;;ctx.fillText(l.type===&#039;shape&#039;?&#039;\u5f62&#039;:&#039;\u5b57&#039;,30,40);}\r\n    const text=document.createElement(&#039;div&#039;),name=document.createElement(&#039;span&#039;),meta=document.createElement(&#039;span&#039;);name.className=&#039;layer-name&#039;;name.textContent=l.name;meta.className=&#039;layer-meta&#039;;meta.textContent=(l.type===&#039;image&#039;?l.image.width+&#039;\u00d7&#039;+l.image.height:l.type===&#039;shape&#039;?&#039;\u5f62\u72b6&#039;:&#039;\u6587\u5b57&#039;)+(l.groupId?&#039; \u00b7 \u7ec4\u5408&#039;:&#039;&#039;)+(l.locked?&#039; \u00b7 \u5df2\u9501\u5b9a&#039;:&#039;&#039;)+(l.visible?&#039;&#039;:&#039; \u00b7 \u9690\u85cf&#039;);text.append(name,meta);\r\n    const actions=document.createElement(&#039;div&#039;);actions.className=&#039;layer-quick-actions&#039;;const lock=document.createElement(&#039;button&#039;);lock.type=&#039;button&#039;;lock.textContent=l.locked?&#039;\u89e3\u9501&#039;:&#039;\u9501\u5b9a&#039;;lock.title=l.locked?&#039;\u89e3\u9501\u56fe\u5c42&#039;:&#039;\u9501\u5b9a\u56fe\u5c42&#039;;lock.setAttribute(&#039;aria-label&#039;,lock.title+&#039; &#039;+l.name);lock.addEventListener(&#039;click&#039;,event=&gt;{event.stopPropagation();if(busy)return;finishCanvasTextEditing();pushHistory();const nextLock=!l.locked;canvasGroupMembers(l).forEach(member=&gt;member.locked=nextLock);renderLayers();syncInspector();draw();});\r\n    const hide=document.createElement(&#039;button&#039;);hide.type=&#039;button&#039;;hide.textContent=l.visible?&#039;\u25c9&#039;:&#039;\u25cb&#039;;hide.setAttribute(&#039;aria-label&#039;,(l.visible?&#039;\u9690\u85cf&#039;:&#039;\u663e\u793a&#039;)+&#039;\u56fe\u5c42 &#039;+l.name);hide.addEventListener(&#039;click&#039;,event=&gt;{event.stopPropagation();if(busy)return;pushHistory();l.visible=!l.visible;renderLayers();draw();});actions.append(lock,hide);item.append(thumb,text,actions);\r\n    item.addEventListener(&#039;click&#039;,event=&gt;selectCanvasLayer(l,event));item.addEventListener(&#039;keydown&#039;,event=&gt;{if(event.target!==item)return;if(event.key===&#039;Enter&#039;||event.key===&#039; &#039;){event.preventDefault();selectCanvasLayer(l,event);}});\r\n    item.addEventListener(&#039;dragstart&#039;,event=&gt;{if(event.target!==item||l.locked||busy){event.preventDefault();return;}if(!selectedIds.has(l.id))selectCanvasLayer(l);const selectionList=selectedCanvasLayers();if(selectionList.some(v=&gt;v.locked)){event.preventDefault();return;}canvasLayerDragIds=selectionList.map(v=&gt;v.id);event.dataTransfer.effectAllowed=&#039;move&#039;;event.dataTransfer.setData(&#039;application\/x-shande-layer&#039;,String(l.id));item.classList.add(&#039;dragging&#039;);});\r\n    item.addEventListener(&#039;dragover&#039;,event=&gt;{if(!canvasLayerDragIds.length||canvasLayerDragIds.includes(l.id))return;event.preventDefault();event.dataTransfer.dropEffect=&#039;move&#039;;item.classList.add(&#039;drop-target&#039;);});item.addEventListener(&#039;dragleave&#039;,()=&gt;item.classList.remove(&#039;drop-target&#039;));\r\n    item.addEventListener(&#039;drop&#039;,event=&gt;{if(!canvasLayerDragIds.length||canvasLayerDragIds.includes(l.id))return;event.preventDefault();event.stopPropagation();const ids=new Set(canvasLayerDragIds),moving=scene.layers.filter(v=&gt;ids.has(v.id)),rest=scene.layers.filter(v=&gt;!ids.has(v.id));if(moving.some(v=&gt;v.locked))return;const above=event.clientY&lt;item.getBoundingClientRect().top+item.getBoundingClientRect().height\/2,target=rest.findIndex(v=&gt;v.id===l.id);pushHistory();rest.splice(target+(above?1:0),0,...moving);scene.layers=rest;canvasLayerDragIds=[];renderLayers();draw();});\r\n    item.addEventListener(&#039;dragend&#039;,()=&gt;{canvasLayerDragIds=[];document.querySelectorAll(&#039;.drop-target,.dragging&#039;).forEach(v=&gt;v.classList.remove(&#039;drop-target&#039;,&#039;dragging&#039;));});box.append(item);\r\n  });\r\n}\r\n\r\nfunction select(id){const l=scene.layers.find(v=&gt;v.id===id);if(l)selectCanvasLayer(l);else setCanvasSelection([],null,false);}\r\nfunction syncInspector(){const l=active();$(&#039;selectedTitle&#039;).textContent=l?l.name:&#039;\u9009\u4e2d\u56fe\u5c42&#039;;$(&#039;textControls&#039;).hidden=!l||l.type!==&#039;text&#039;;$(&#039;shapeControls&#039;).hidden=!l||l.type!==&#039;shape&#039;;if(l&amp;&amp;l.type===&#039;shape&#039;){$(&#039;shapeFill&#039;).value=l.color;$(&#039;shapeNoFill&#039;).checked=!!l.noFill;}const isImage=l&amp;&amp;l.type===&#039;image&#039;;[&#039;pixelW&#039;,&#039;pixelH&#039;,&#039;applyPixelResize&#039;,&#039;singleExport&#039;].forEach(id=&gt;$(id).disabled=!isImage);if(isImage){$(&#039;pixelW&#039;).value=l.image.width;$(&#039;pixelH&#039;).value=l.image.height;$(&#039;pixelSizeInfo&#039;).textContent=&#039;\u5f53\u524d\u56fe\u7247 &#039;+l.image.width+&#039; \u00d7 &#039;+l.image.height+&#039; px\uff1b\u6b64\u5904\u4fee\u6539\u5b9e\u9645\u50cf\u7d20\u3002&#039;;}else $(&#039;pixelSizeInfo&#039;).textContent=&#039;\u8bf7\u5148\u9009\u62e9\u56fe\u7247\u56fe\u5c42\u3002\u6587\u5b57\u3001\u5f62\u72b6\u7684\u5927\u5c0f\u5728\u6392\u7248\u8bbe\u7f6e\u4e2d\u8c03\u6574\u3002&#039;;[&#039;layerX&#039;,&#039;layerY&#039;,&#039;layerW&#039;,&#039;layerH&#039;,&#039;layerRotation&#039;,&#039;layerOpacity&#039;,&#039;strokeWidth&#039;,&#039;strokeColor&#039;,&#039;shadowBlur&#039;,&#039;shadowColor&#039;,&#039;shadowX&#039;,&#039;shadowY&#039;,&#039;centerLayer&#039;,&#039;duplicate&#039;,&#039;deleteLayer&#039;,&#039;layerUp&#039;,&#039;layerDown&#039;].forEach(id=&gt;$(id).disabled=!l);if(l){const map={layerX:l.x,layerY:l.y,layerW:l.width,layerH:l.height,layerRotation:l.rotation,layerOpacity:l.opacity*100,strokeWidth:l.strokeWidth,strokeColor:l.strokeColor,shadowBlur:l.shadowBlur,shadowColor:l.shadowColor,shadowX:l.shadowOffsetX,shadowY:l.shadowOffsetY};Object.keys(map).forEach(id=&gt;$(id).value=typeof map[id]===&#039;number&#039;?Math.round(map[id]*100)\/100:map[id]);$(&#039;opacityValue&#039;).value=Math.round(l.opacity*100)+&#039;%&#039;;if(l.type===&#039;text&#039;){if(document.activeElement!==$(&#039;textValue&#039;))$(&#039;textValue&#039;).value=l.text;$(&#039;textSize&#039;).value=l.fontSize;$(&#039;textColor&#039;).value=l.color;$(&#039;textFont&#039;).value=l.fontFamily;$(&#039;textBold&#039;).checked=l.fontWeight===&#039;bold&#039;;$(&#039;textAlign&#039;).value=l.align;$(&#039;textLineHeight&#039;).value=l.lineHeight||1.3;}}$(&#039;canvasW&#039;).value=scene.width;$(&#039;canvasH&#039;).value=scene.height;$(&#039;transparentBg&#039;).checked=scene.background===null;$(&#039;canvasBg&#039;).value=scene.background||&#039;#ffffff&#039;;[&#039;cropSelection&#039;,&#039;extractSelection&#039;,&#039;mosaicSelection&#039;,&#039;downloadSelection&#039;].forEach(id=&gt;$(id).disabled=!selection);$(&#039;queueSelection&#039;).disabled=!selection||lastSelectionQueued;[&#039;rotateLeft&#039;,&#039;rotateRight&#039;,&#039;flipX&#039;,&#039;flipY&#039;,&#039;trimTransparent&#039;,&#039;resetPixels&#039;,&#039;applyAdjust&#039;].forEach(id=&gt;$(id).disabled=!l||l.type!==&#039;image&#039;);syncGridControls();syncCanvasInteractionControls();}\r\nfunction displayLayers(forPreview=true){return scene.layers.map(l=&gt;forPreview&amp;&amp;l.id===selected&amp;&amp;comparingOriginal&amp;&amp;l.type===&#039;image&#039;?{...l,image:l.original,canvas:l.original}:l.id===selected&amp;&amp;adjusted?{...l,image:adjusted,canvas:adjusted}:l);}\r\nfunction selectionViewport(){const l=active();return workspaceMode===&#039;selection&#039;&amp;&amp;l&amp;&amp;l.type===&#039;image&#039;?{width:l.image.width,height:l.image.height,layer:l}:{width:scene.width,height:scene.height,layer:null};}\r\nfunction draw(){try{const view=selectionViewport();previewScale=zoomLevel===null?Math.min(1,1400\/view.width,1400\/view.height):Math.min(1,Math.max(1400\/view.width,1400\/view.height,zoomLevel));previewScale=Math.min(previewScale,Math.sqrt(MAX_SCENE\/(view.width*view.height)));const rendered=view.layer?C.resize(comparingOriginal?view.layer.original:view.layer.image,Math.max(1,Math.round(view.width*previewScale)),Math.max(1,Math.round(view.height*previewScale))):C.renderScene({...scene,layers:displayLayers()},{scale:previewScale});const stage=$(&#039;stage&#039;);if(stage.width!==rendered.width||stage.height!==rendered.height){stage.width=rendered.width;stage.height=rendered.height;}const ctx=stage.getContext(&#039;2d&#039;);ctx.clearRect(0,0,stage.width,stage.height);ctx.drawImage(rendered,0,0);C.release(rendered);const l=active();if(selection&amp;&amp;!comparingOriginal&amp;&amp;l&amp;&amp;l.type===&#039;image&#039;){ctx.save();ctx.scale(previewScale,previewScale);if(!view.layer){ctx.translate(l.x+l.width\/2,l.y+l.height\/2);ctx.rotate(l.rotation*Math.PI\/180);const f=canvasSourceGeometry(l);ctx.translate(f.x,f.y);ctx.scale(f.width\/l.image.width,f.height\/l.image.height);}ctx.strokeStyle=&#039;#1677c7&#039;;ctx.fillStyle=&#039;#1677c718&#039;;const sourceScale=view.layer?1:canvasSourceGeometry(l).width\/l.image.width;ctx.lineWidth=2\/(previewScale*sourceScale);ctx.setLineDash([5\/(previewScale*sourceScale),3\/(previewScale*sourceScale)]);ctx.beginPath();C.selectionPath(ctx,selection);ctx.fill();ctx.stroke();ctx.restore();}$(&#039;emptyStage&#039;).hidden=scene.layers.length&gt;0||scene.canvasFixed;$(&#039;canvasInfo&#039;).textContent=(view.layer?&#039;\u539f\u56fe &#039;:&#039;\u753b\u5e03 &#039;)+view.width+&#039; \u00d7 &#039;+view.height;$(&#039;selectionInfo&#039;).textContent=selection?Math.round(selection.width||0)+&#039; \u00d7 &#039;+Math.round(selection.height||0)+&#039;\u50cf\u7d20\u9009\u533a&#039;:&#039;\u5c1a\u672a\u9009\u62e9\u533a\u57df&#039;;applyZoom();drawInteractionOverlay(ctx);updateHistory();refreshGridPreview();}catch(e){show(e.message||String(e),true);}}\r\nfunction stagePoint(event){const rect=$(&#039;stage&#039;).getBoundingClientRect();const view=selectionViewport();return{x:(event.clientX-rect.left)\/rect.width*view.width,y:(event.clientY-rect.top)\/rect.height*view.height};}\r\nfunction canvasSourceGeometry(l){return l.frameCrop?C.imageFrameGeometry(l.image.width,l.image.height,l.width,l.height,l.frameCrop):{x:-l.width\/2,y:-l.height\/2,width:l.width,height:l.height};}\r\nfunction localPoint(p,l){if(workspaceMode===&#039;selection&#039;)return p;const dx=p.x-(l.x+l.width\/2),dy=p.y-(l.y+l.height\/2),r=-l.rotation*Math.PI\/180,f=canvasSourceGeometry(l);return{x:(dx*Math.cos(r)-dy*Math.sin(r)-f.x)*l.image.width\/f.width,y:(dx*Math.sin(r)+dy*Math.cos(r)-f.y)*l.image.height\/f.height};}\r\nfunction boundedPoint(p,l){return{x:Math.max(0,Math.min(l.image.width,p.x)),y:Math.max(0,Math.min(l.image.height,p.y))};}\r\nfunction hitLayer(p){for(let i=scene.layers.length-1;i&gt;=0;i--){const l=scene.layers[i];if(!l.visible)continue;const dx=p.x-(l.x+l.width\/2),dy=p.y-(l.y+l.height\/2),r=-l.rotation*Math.PI\/180,x=dx*Math.cos(r)-dy*Math.sin(r),y=dx*Math.sin(r)+dy*Math.cos(r);if(Math.abs(x)&lt;=l.width\/2&amp;&amp;Math.abs(y)&lt;=l.height\/2)return l;}return null;}\r\nfunction setTool(value){const preserve=workspaceMode===&#039;selection&#039;&amp;&amp;[&#039;rect&#039;,&#039;ellipse&#039;,&#039;lasso&#039;].includes(value)&amp;&amp;[&#039;add&#039;,&#039;subtract&#039;].includes($(&#039;selectionCombineMode&#039;)?.value);tool=value;if([&#039;rect&#039;,&#039;ellipse&#039;,&#039;lasso&#039;].includes(value))selectionTool=value;if(!preserve)selection=null;lastSelectionQueued=false;lastQueuedCutId=null;document.querySelectorAll(&#039;[data-tool]&#039;).forEach(b=&gt;{b.classList.toggle(&#039;active&#039;,b.dataset.tool===tool);b.setAttribute(&#039;aria-pressed&#039;,b.dataset.tool===tool?&#039;true&#039;:&#039;false&#039;);});const hints={move:&#039;\u62d6\u52a8\u5bf9\u8c61\u79fb\u52a8\uff0c\u62d6\u52a8\u89d2\u70b9\u7f29\u653e\u6216\u5706\u70b9\u65cb\u8f6c\uff1bShift \u591a\u9009\uff0c\u53cc\u51fb\u6587\u5b57\u7f16\u8f91\u3002&#039;,rect:workspaceMode===&#039;selection&#039;?&#039;\u62d6\u51fa\u77e9\u5f62\uff0c\u677e\u5f00\u751f\u6210\u72ec\u7acb\u5207\u7247\u3002\u539f\u56fe\u4fdd\u7559\u3002&#039;:&#039;\u62d6\u51fa\u77e9\u5f62\u9009\u533a\uff0c\u518d\u70b9\u51fb\u201c\u5e94\u7528\u88c1\u526a\u201d\u3002&#039;,ellipse:&#039;\u62d6\u51fa\u692d\u5706\uff0c\u677e\u5f00\u751f\u6210\u5207\u7247\u3002\u6309\u4f4f Shift \u53ef\u753b\u6b63\u5706\u3002&#039;,lasso:&#039;\u6cbf\u8f6e\u5ed3\u5708\u9009\uff0c\u677e\u5f00\u751f\u6210\u5207\u7247\uff0c\u53ef\u8fde\u7eed\u5708\u9009\u3002&#039;,erase:&#039;\u6309\u4f4f\u9f20\u6807\u64e6\u9664\u5f53\u524d\u56fe\u7247\uff1b\u8bf7\u5728\u56fe\u7247\u5de5\u5177\u9762\u677f\u8c03\u6574\u753b\u7b14\u5927\u5c0f\u3002&#039;,restore:&#039;\u6309\u4f4f\u9f20\u6807\u6062\u590d\u5f53\u524d\u56fe\u7247\u88ab\u64e6\u9664\u7684\u50cf\u7d20\uff1b\u5df2\u5e94\u7528\u88c1\u526a\u6216\u8c03\u8272\u524d\u7684\u5185\u5bb9\u53ef\u64a4\u9500\u627e\u56de\u3002&#039;,mosaic:&#039;\u6309\u4f4f\u9f20\u6807\u5728\u5f53\u524d\u56fe\u7247\u4e0a\u6d82\u62b9\u9a6c\u8d5b\u514b\u3002&#039;,pick:&#039;\u70b9\u51fb\u753b\u5e03\u53d6\u8272\uff0c\u53ef\u590d\u5236\u8272\u503c\uff0c\u6216\u5728\u5de5\u5177\u9762\u677f\u4e2d\u5c06\u989c\u8272\u7528\u4e8e\u6587\u5b57\u548c\u80cc\u666f\u3002&#039;};$(&#039;toolHint&#039;).textContent=hints[tool];updateSelectionToolHint();$(&#039;stage&#039;).style.cursor=tool===&#039;move&#039;?&#039;move&#039;:&#039;crosshair&#039;;syncInspector();draw();}\r\nfunction startPointer(event){if(canvasInteractionStart(event))return;if(comparingOriginal||busy||drag||event.button&gt;0)return;const p=stagePoint(event);if(tool===&#039;pick&#039;){const rendered=C.renderScene({...scene,layers:displayLayers()},{scale:previewScale}),x=Math.min(rendered.width-1,Math.max(0,Math.floor(p.x*previewScale))),y=Math.min(rendered.height-1,Math.max(0,Math.floor(p.y*previewScale))),d=rendered.getContext(&#039;2d&#039;).getImageData(x,y,1,1).data,hex=&#039;#&#039;+Array.from(d).slice(0,3).map(n=&gt;n.toString(16).padStart(2,&#039;0&#039;)).join(&#039;&#039;);const box=$(&#039;pickedColor&#039;);box.hidden=false;box.replaceChildren();const chip=document.createElement(&#039;span&#039;);chip.className=&#039;color-chip&#039;;chip.style.background=hex;const btn=document.createElement(&#039;button&#039;);btn.textContent=hex+(d[3]===0?&#039;\uff08\u900f\u660e\u50cf\u7d20\uff09&#039;:&#039;&#039;);btn.addEventListener(&#039;click&#039;,async()=&gt;{try{await navigator.clipboard.writeText(hex);show(&#039;\u5df2\u590d\u5236 &#039;+hex);}catch(e){show(&#039;\u8272\u503c\u4e3a &#039;+hex+&#039;\uff0c\u53ef\u624b\u52a8\u590d\u5236\u3002&#039;);}});box.append(chip,btn);show(&#039;\u5f53\u524d\u8272\u503c &#039;+hex+(d[3]===0?&#039;\uff1b\u8be5\u4f4d\u7f6e\u5b8c\u5168\u900f\u660e\u3002&#039;:&#039;&#039;));return;}if(tool===&#039;move&#039;){const hit=hitLayer(p);if(!hit)return;if(hit.id!==selected)select(hit.id);pushHistory();drag={kind:&#039;move&#039;,start:p,x:hit.x,y:hit.y,id:hit.id};}else{let l;try{l=imageLayer();}catch(e){show(e.message,true);return;}if(l.locked){show(&#039;\u8be5\u56fe\u5c42\u5df2\u9501\u5b9a\uff0c\u8bf7\u5148\u89e3\u9501\u3002&#039;,true);return;}if(adjusted){show(&#039;\u8bf7\u5148\u5e94\u7528\u6216\u91cd\u7f6e\u8c03\u8272\u6ed1\u5757\uff0c\u518d\u4f7f\u7528\u9009\u533a\u548c\u753b\u7b14\u3002&#039;,true);return;}const local=boundedPoint(localPoint(p,l),l);if(tool===&#039;rect&#039;||tool===&#039;ellipse&#039;||tool===&#039;lasso&#039;){const previousSelection=selection;lastSelectionQueued=false;lastQueuedCutId=null;selection=tool===&#039;lasso&#039;?{type:&#039;lasso&#039;,points:[local],x:local.x,y:local.y,width:0,height:0}:{type:tool,x:local.x,y:local.y,width:0,height:0};drag={kind:&#039;selection&#039;,start:local,id:l.id,previousSelection};}else{pushHistory();drag={kind:&#039;brush&#039;,last:local,id:l.id};paint(l,[local]);}}drag.pointerId=event.pointerId;$(&#039;stage&#039;).setPointerCapture(event.pointerId);event.preventDefault();draw();}\r\nfunction paint(l,points){if(tool===&#039;mosaic&#039;)C.mosaic(l.image,{points,radius:Number($(&#039;brushSize&#039;).value)\/2,blockSize:Number($(&#039;mosaicSize&#039;).value)});else C.retouchBrush(l.image,{mode:tool,points,radius:Number($(&#039;brushSize&#039;).value)\/2,baseline:l.baseline,color:$(&#039;brushColor&#039;).value,softness:Number($(&#039;brushSoftness&#039;).value)\/100,strength:Number($(&#039;brushStrength&#039;).value)\/100,blurRadius:Number($(&#039;blurRadius&#039;).value)});}\r\nfunction movePointer(event){if(canvasInteractionMove(event))return;if(!drag||drag.pointerId!==undefined&amp;&amp;event.pointerId!==drag.pointerId)return;const l=scene.layers.find(l=&gt;l.id===drag.id);if(!l)return;const p=stagePoint(event);if(drag.kind===&#039;move&#039;){l.x=Math.round(drag.x+p.x-drag.start.x);l.y=Math.round(drag.y+p.y-drag.start.y);}else{const q=boundedPoint(localPoint(p,l),l);if(drag.kind===&#039;selection&#039;){if(selection.type===&#039;lasso&#039;){const previous=selection.points[selection.points.length-1];if(Math.hypot(q.x-previous.x,q.y-previous.y)&gt;.35){const right=Math.max(selection.x+selection.width,q.x),bottom=Math.max(selection.y+selection.height,q.y);selection.points.push(q);selection.x=Math.min(selection.x,q.x);selection.y=Math.min(selection.y,q.y);selection.width=right-selection.x;selection.height=bottom-selection.y;}}else{let dx=q.x-drag.start.x,dy=q.y-drag.start.y;const ratio=event.shiftKey?1:tool===&#039;rect&#039;?canvasCropRatio():0;if(ratio){let w=Math.abs(dx),h=Math.abs(dy);if(w\/h&gt;ratio)h=w\/ratio;else w=h*ratio;const sx=dx&lt;0?-1:1,sy=dy&lt;0?-1:1,limit=Math.min(1,(sx&gt;0?l.image.width-drag.start.x:drag.start.x)\/Math.max(1,w),(sy&gt;0?l.image.height-drag.start.y:drag.start.y)\/Math.max(1,h));dx=sx*w*limit;dy=sy*h*limit;}selection.x=Math.min(drag.start.x,drag.start.x+dx);selection.y=Math.min(drag.start.y,drag.start.y+dy);selection.width=Math.abs(dx);selection.height=Math.abs(dy);}}else{paint(l,[drag.last,q]);drag.last=q;markChanged();}}draw();}\r\nfunction cancelPointer(event){if(canvasInteractionEnd(event,true))return;if(!drag||event&amp;&amp;drag.pointerId!==undefined&amp;&amp;event.pointerId!==drag.pointerId)return;if(drag.kind===&#039;selection&#039;){selection=null;lastSelectionQueued=false;lastQueuedCutId=null;}drag=null;renderLayers();syncInspector();draw();}\r\nfunction endPointer(event){if(canvasInteractionEnd(event))return;if(!drag||event&amp;&amp;drag.pointerId!==undefined&amp;&amp;event.pointerId!==drag.pointerId)return;const kind=drag.kind,previousSelection=drag.previousSelection;drag=null;if(kind===&#039;selection&#039;&amp;&amp;(!selection||selection.width&lt;1||selection.height&lt;1||selection.type===&#039;lasso&#039;&amp;&amp;selection.points.length&lt;3))selection=null;if(kind===&#039;selection&#039;&amp;&amp;selection&amp;&amp;workspaceMode===&#039;selection&#039;){if(typeof refineCompletedSelection===&#039;function&#039;)refineCompletedSelection(previousSelection);if($(&#039;autoSlice&#039;)?.checked!==false&amp;&amp;(! $(&#039;selectionCombineMode&#039;)||$(&#039;selectionCombineMode&#039;).value===&#039;new&#039;))addCurrentCut(true);}if(kind===&#039;brush&#039;)renderLayers();syncInspector();draw();}\r\nfunction modifyPixels(fn,message){try{const l=imageLayer();if(l.locked)throw Error(&#039;\u8be5\u56fe\u5c42\u5df2\u9501\u5b9a\uff0c\u8bf7\u5148\u89e3\u9501\u3002&#039;);if(adjusted)throw Error(&#039;\u8bf7\u5148\u5e94\u7528\u6216\u91cd\u7f6e\u8c03\u8272\u3002&#039;);pushHistory();const next=fn(l.image,l);if(next){const scaleX=l.width\/l.image.width,scaleY=l.height\/l.image.height;let cx=l.x+l.width\/2,cy=l.y+l.height\/2;if(next.trimBounds){const b=next.trimBounds,r=l.rotation*Math.PI\/180,dx=(b.x+b.width\/2)*scaleX-l.width\/2,dy=(b.y+b.height\/2)*scaleY-l.height\/2;cx+=dx*Math.cos(r)-dy*Math.sin(r);cy+=dx*Math.sin(r)+dy*Math.cos(r);}l.image=next;l.canvas=next;l.width=next.width*scaleX;l.height=next.height*scaleY;l.x=cx-l.width\/2;l.y=cy-l.height\/2;l.baseline=cloneCanvas(next);}selection=null;renderLayers();syncInspector();draw();show(message);}catch(e){show(e.message||String(e),true);}}\r\nfunction applySelection(extract){try{const l=imageLayer();if(l.locked)throw Error(&#039;\u8be5\u56fe\u5c42\u5df2\u9501\u5b9a\uff0c\u8bf7\u5148\u89e3\u9501\u3002&#039;);if(!selection)throw Error(&#039;\u8bf7\u5148\u5728\u56fe\u7247\u4e0a\u753b\u51fa\u9009\u533a\u3002&#039;);if(adjusted)throw Error(&#039;\u8bf7\u5148\u5e94\u7528\u6216\u91cd\u7f6e\u8c03\u8272\u3002&#039;);if(extract&amp;&amp;(scene.layers.length&gt;=50||scene.layers.filter(v=&gt;v.type===&#039;image&#039;).length&gt;=MAX_IMAGES))throw Error(&#039;\u9879\u76ee\u6700\u591a20\u5f20\u56fe\u7247\u300150\u4e2a\u56fe\u5c42\uff0c\u8bf7\u79fb\u9664\u4e0d\u7528\u7684\u56fe\u5c42\u3002&#039;);const result=extract?C.extractSelection(l.image,selection):(selection.type===&#039;rect&#039;?C.crop(l.image,selection):C.extractSelection(l.image,selection));if(pixelCount()+(extract?result.width*result.height:0)&gt;MAX_ASSET_PIXELS)throw Error(&#039;\u63d0\u53d6\u540e\u7684\u9879\u76ee\u56fe\u7247\u603b\u50cf\u7d20\u8d85\u51fa3200\u4e07\uff0c\u8bf7\u5220\u9664\u4e0d\u7528\u7684\u56fe\u5c42\u540e\u518d\u63d0\u53d6\u3002&#039;);const fitPhoto=!extract&amp;&amp;!scene.canvasFixed&amp;&amp;scene.layers.length===1;pushHistory();const box=C.selectionBounds(selection,l.image),frame=l.frameCrop&amp;&amp;C.imageFrameGeometry?C.imageFrameGeometry(l.image.width,l.image.height,l.width,l.height,l.frameCrop):null,sx=(frame?frame.width:l.width)\/l.image.width,sy=(frame?frame.height:l.height)\/l.image.height,originX=frame?frame.x:-l.width\/2,originY=frame?frame.y:-l.height\/2;if(extract){const next=makeImage(result,l.name+&#039;-\u63d0\u53d6&#039;);const r=l.rotation*Math.PI\/180,dx=originX+(box.x+result.width\/2)*sx,dy=originY+(box.y+result.height\/2)*sy;next.width=result.width*sx;next.height=result.height*sy;next.rotation=l.rotation;next.x=l.x+l.width\/2+dx*Math.cos(r)-dy*Math.sin(r)-next.width\/2;next.y=l.y+l.height\/2+dx*Math.sin(r)+dy*Math.cos(r)-next.height\/2;scene.layers.push(next);selected=next.id;}else{const r=l.rotation*Math.PI\/180,dx=originX+(box.x+result.width\/2)*sx,dy=originY+(box.y+result.height\/2)*sy;const cx=l.x+l.width\/2+dx*Math.cos(r)-dy*Math.sin(r),cy=l.y+l.height\/2+dx*Math.sin(r)+dy*Math.cos(r);l.width=result.width*sx;l.height=result.height*sy;l.x=cx-l.width\/2;l.y=cy-l.height\/2;l.image=result;l.canvas=result;l.baseline=cloneCanvas(result);if(fitPhoto){l.width=result.width;l.height=result.height;const radians=(l.rotation||0)*Math.PI\/180,cos=Math.abs(Math.cos(radians)),sin=Math.abs(Math.sin(radians));scene.width=Math.max(1,Math.ceil(result.width*cos+result.height*sin-1e-8));scene.height=Math.max(1,Math.ceil(result.width*sin+result.height*cos-1e-8));l.x=(scene.width-l.width)\/2;l.y=(scene.height-l.height)\/2;zoomLevel=null;}delete l.frameCrop;}selection=null;renderLayers();syncInspector();draw();show(extract?&#039;\u5df2\u63d0\u53d6\u4e3a\u65b0\u56fe\u5c42\u3002\u4e0b\u8f7d\u9009\u4e2d\u56fe\u5c42\u53ef\u4fdd\u7559\u900f\u660e\u80cc\u666f\u3002&#039;:fitPhoto?&#039;\u5df2\u88c1\u526a\u7167\u7247\uff0c\u5bfc\u51fa\u753b\u5e03\u540c\u6b65\u4e3a &#039;+scene.width+&#039; \u00d7 &#039;+scene.height+&#039; px\u3002&#039;:&#039;\u5df2\u88c1\u526a\u5f53\u524d\u56fe\u7247\uff0c\u6d77\u62a5\u5c3a\u5bf8\u4fdd\u6301\u4e0d\u53d8\u3002&#039;);}catch(e){show(e.message,true);}}\r\nconst adjustIds=[&#039;brightness&#039;,&#039;contrast&#039;,&#039;saturation&#039;,&#039;temperature&#039;];\r\nfunction adjustValues(){const values={};adjustIds.forEach(id=&gt;values[id]=Number($(id).value));values.grayscale=$(&#039;grayscale&#039;).checked?100:0;return values;}\r\nfunction resetAdjust(redraw=true){clearTimeout(adjustTimer);adjustIds.forEach(id=&gt;{$(id).value=0;$(id+&#039;Value&#039;).value=&#039;0&#039;;});$(&#039;grayscale&#039;).checked=false;adjusted=null;refreshRetouchPreviews(true);if(redraw)draw();}\r\nlet adjustTimer;\r\nfunction previewAdjust(){adjustIds.forEach(id=&gt;$(id+&#039;Value&#039;).value=$(id).value);refreshRetouchPreviews();clearTimeout(adjustTimer);adjustTimer=setTimeout(()=&gt;{try{const l=imageLayer();adjusted=C.adjust(l.image,adjustValues());draw();}catch(e){show(e.message,true);}},180);}\r\nfunction addText(){if(scene.layers.length&gt;=50){show(&#039;\u9879\u76ee\u6700\u591a50\u4e2a\u56fe\u5c42\u3002&#039;,true);return;}pushHistory();const l={id:nextId++,type:&#039;text&#039;,name:&#039;\u6587\u5b57&#039;,text:&#039;\u95ea\u5f97\u7d20\u6750&#039;,fontSize:Math.max(24,Math.round(scene.width*.05)),fontFamily:&#039;sans-serif&#039;,fontWeight:&#039;normal&#039;,align:&#039;left&#039;,lineHeight:1.3,color:&#039;#182230&#039;,width:Math.round(scene.width*.65),height:Math.round(scene.height*.15),x:Math.round(scene.width*.175),y:Math.round(scene.height*.425),rotation:0,opacity:1,visible:true,strokeWidth:0,strokeColor:&#039;#ffffff&#039;,shadowBlur:0,shadowColor:&#039;#000000&#039;,shadowOffsetX:0,shadowOffsetY:0};scene.layers.push(l);selected=l.id;selection=null;resetAdjust(false);setTool(&#039;move&#039;);renderLayers();syncInspector();draw();setMode(&#039;text&#039;);}\r\nfunction changeLayer(id,key){const l=active();if(!canvasCanChange(l)||selectedCanvasLayers().length!==1)return;let value=$(id).type===&#039;color&#039;?$(id).value:Number($(id).value);if(typeof value===&#039;number&#039;&amp;&amp;!Number.isFinite(value))return;pushHistory();if(key===&#039;width&#039;||key===&#039;height&#039;){value=Math.max(1,Math.min(16384,value));if($(&#039;keepRatio&#039;).checked){const r=l.width\/l.height;if(key===&#039;width&#039;)l.height=value\/r;else l.width=value*r;}}if(key===&#039;opacity&#039;)value=Math.max(0,Math.min(1,value\/100));if(key===&#039;strokeWidth&#039;)value=Math.max(0,Math.min(40,value));if(key===&#039;shadowBlur&#039;)value=Math.max(0,Math.min(100,value));if(key===&#039;shadowOffsetX&#039;||key===&#039;shadowOffsetY&#039;)value=Math.max(-100,Math.min(100,value));if(key===&#039;rotation&#039;)value=Math.max(-360,Math.min(360,value));l[key]=value;syncInspector();draw();}\r\nfunction canvasResize(w,h){try{const s=guardSize(w,h);pushHistory();scene.canvasFixed=true;if($(&#039;scaleLayers&#039;).checked){const sx=s.w\/scene.width,sy=s.h\/scene.height;scene.layers.forEach(l=&gt;{l.x*=sx;l.y*=sy;l.width*=sx;l.height*=sy;if(l.type===&#039;text&#039;)l.fontSize=Math.max(8,Math.min(500,l.fontSize*Math.min(sx,sy)));});}scene.width=s.w;scene.height=s.h;syncInspector();draw();show(&#039;\u753b\u5e03\u5c3a\u5bf8\u5df2\u4fee\u6539\u3002&#039;);}catch(e){show(e.message,true);}}\r\nfunction exportOptions(layerOnly=$(&#039;exportTarget&#039;).value===&#039;layer&#039;){\r\n  const format=$(&#039;exportFormat&#039;).value;if(![&#039;png&#039;,&#039;jpeg&#039;,&#039;webp&#039;].includes(format))throw Error(&#039;\u8bf7\u9009\u62e9\u6709\u6548\u7684\u5bfc\u51fa\u683c\u5f0f\u3002&#039;);\r\n  const quality=Math.max(.1,Math.min(1,(Number($(&#039;exportQuality&#039;).value)||90)\/100));\r\n  const advanced=$(&#039;exportHD&#039;).checked||(format!==&#039;png&#039;&amp;&amp;quality&gt;.9);\r\n  const maxW=Number($(&#039;exportWidth&#039;).value)||0,maxH=Number($(&#039;exportHeight&#039;).value)||0;\r\n  if(!Number.isFinite(maxW)||!Number.isFinite(maxH)||maxW&lt;0||maxH&lt;0||maxW&gt;8192||maxH&gt;8192)throw Error(&#039;\u8f93\u51fa\u8fb9\u957f\u8bf7\u586b\u51990\u52308192\u50cf\u7d20\u3002&#039;);\r\n  const targetMode=format!==&#039;png&#039;&amp;&amp;$(&#039;exportCompression&#039;).value===&#039;target&#039;,targetKB=Number($(&#039;exportTargetKB&#039;).value);\r\n  if(targetMode&amp;&amp;(!Number.isFinite(targetKB)||targetKB&lt;1||targetKB&gt;100000))throw Error(&#039;\u76ee\u6807\u5927\u5c0f\u8bf7\u586b\u51991\u5230100000KB\u3002&#039;);\r\n  return {layerOnly,format,quality,advanced,maxW,maxH,targetBytes:targetMode?Math.floor(targetKB*1024):0};\r\n}\r\nfunction exportKey(options){return JSON.stringify({revision:editRevision,selected,adjusted:!!adjusted,adjust:adjusted?adjustValues():null,options});}\r\nasync function encodeToTarget(canvas,options,encode=(quality)=&gt;C.encode(canvas,{format:options.format,quality,background:&#039;#ffffff&#039;})){\r\n  let high=options.quality,low=.1;let best=await encode(high);const target=options.targetBytes;\r\n  if(!target||best.size&lt;=target)return {blob:best,quality:high,targetMet:true};\r\n  const minimum=await encode(low);if(minimum.size&gt;target)return {blob:minimum,quality:low,targetMet:false};\r\n  best=minimum;let bestQuality=low;\r\n  \/\/ Eight bounded trials keep the output dimensions fixed and select a tested blob.\r\n  for(let i=0;i&lt;8&amp;&amp;high-low&gt;.003;i++){const q=(low+high)\/2,blob=await encode(q);if(blob.size&lt;=target){low=q;if(q&gt;bestQuality){best=blob;bestQuality=q;}}else high=q;}\r\n  return {blob:best,quality:bestQuality,targetMet:true};\r\n}\r\nfunction canvasHasTransparency(canvas){const ctx=canvas.getContext(&#039;2d&#039;);for(let y=0;y&lt;canvas.height;y+=64){const data=ctx.getImageData(0,y,canvas.width,Math.min(64,canvas.height-y)).data;for(let i=3;i&lt;data.length;i+=4)if(data[i]!==255)return true;}return false;}\r\nasync function renderExportResult(options){\r\n  if(fontTaskBusy||missingSiteFonts(options.layerOnly).length)throw Error(&#039;\u8bf7\u5148\u6062\u590d\u6216\u5b8c\u6210\u52a0\u8f7d\u672c\u7ad9\u5b57\u4f53\uff0c\u518d\u5bfc\u51fa\u3002&#039;);\r\n  if(document.fonts)await document.fonts.ready;\r\n  if(fontTaskBusy||missingSiteFonts(options.layerOnly).length)throw Error(&#039;\u5b57\u4f53\u4ecd\u672a\u5c31\u7eea\uff0c\u8bf7\u6062\u590d\u672c\u7ad9\u5b57\u4f53\u540e\u91cd\u8bd5\u3002&#039;);\r\n  if(!scene.layers.length&amp;&amp;!scene.canvasFixed)throw Error(&#039;\u8bf7\u5148\u6dfb\u52a0\u56fe\u7247\u6216\u65b0\u5efa\u8bbe\u8ba1\u3002&#039;);\r\n  let canvas,output;\r\n  try{\r\n    if(options.layerOnly){const l=active();if(!l)throw Error(&#039;\u8bf7\u5148\u9009\u62e9\u56fe\u5c42\u3002&#039;);canvas=l.type===&#039;image&#039;?cloneCanvas(l.id===selected&amp;&amp;adjusted?adjusted:l.image):C.renderScene({width:Math.ceil(l.width),height:Math.ceil(l.height),background:null,layers:[{...l,x:0,y:0,rotation:0,visible:true}]});}\r\n    else canvas=C.renderScene({...scene,layers:displayLayers(false)});\r\n    const ratio=Math.min(1,options.advanced?1:2048\/canvas.width,options.advanced?1:2048\/canvas.height,options.maxW?options.maxW\/canvas.width:1,options.maxH?options.maxH\/canvas.height:1);\r\n    output=ratio&lt;1?C.resize(canvas,Math.max(1,Math.round(canvas.width*ratio)),Math.max(1,Math.round(canvas.height*ratio))):canvas;\r\n    const transparent=canvasHasTransparency(output),result=await encodeToTarget(output,options);\r\n    return {...result,width:output.width,height:output.height,transparent:options.format!==&#039;jpeg&#039;&amp;&amp;transparent,flattened:options.format===&#039;jpeg&#039;&amp;&amp;transparent,format:options.format};\r\n  }finally{if(output&amp;&amp;output!==canvas)C.release(output);if(canvas)C.release(canvas);}\r\n}\r\nfunction encodedSize(bytes){return (bytes\/1024).toFixed(bytes&lt;10240?2:1)+&#039; KB\uff08&#039;+bytes.toLocaleString()+&#039; \u5b57\u8282\uff09&#039;;}\r\nfunction showExportResult(result){\r\n  if(exportPreviewURL)URL.revokeObjectURL(exportPreviewURL);exportPreviewURL=URL.createObjectURL(result.blob);$(&#039;exportPreview&#039;).src=exportPreviewURL;$(&#039;exportPreview&#039;).hidden=false;\r\n  $(&#039;exportEncodedInfo&#039;).textContent=result.width+&#039; \u00d7 &#039;+result.height+&#039; px \u00b7 &#039;+encodedSize(result.blob.size)+&#039; \u00b7 &#039;+(result.transparent?&#039;\u542b\u900f\u660e\u533a\u57df&#039;:result.flattened?&#039;\u900f\u660e\u533a\u57df\u5df2\u586b\u5145\u767d\u8272&#039;:&#039;\u4e0d\u542b\u900f\u660e\u533a\u57df&#039;)+(result.format===&#039;png&#039;?&#039;&#039;:&#039; \u00b7 \u5b9e\u9645\u8d28\u91cf &#039;+Math.round(result.quality*100))+(result.targetMet?&#039;&#039;:&#039;\u3002\u4fdd\u6301\u6b64\u5c3a\u5bf8\u3001\u6700\u4f4e\u8d28\u91cf10\u4ecd\u65e0\u6cd5\u8fbe\u5230\u76ee\u6807\u3002\u8bf7\u63d0\u9ad8\u76ee\u6807KB\uff0c\u6216\u81ea\u884c\u4fee\u6539\u8f93\u51fa\u5c3a\u5bf8\uff1b\u4e5f\u53ef\u5207\u56de\u201c\u6309\u8d28\u91cf\u201d\u4e0b\u8f7d\u3002&#039;);\r\n  $(&#039;exportScene&#039;).disabled=!result.targetMet;\r\n}\r\nfunction invalidateExportPreview(){clearTimeout(exportPreviewTimer);exportPreviewSerial++;exportCached=null;if($(&#039;exportDialog&#039;)?.open){$(&#039;exportScene&#039;).disabled=true;$(&#039;exportEncodedInfo&#039;).textContent=&#039;\u8bbe\u7f6e\u5df2\u6539\u53d8\uff0c\u6b63\u5728\u8ba1\u7b97\u5b9e\u9645\u6587\u4ef6\u5927\u5c0f\u2026&#039;;exportPreviewTimer=setTimeout(refreshExportPreview,350);}}\r\nasync function refreshExportPreview(){\r\n  if(exportPreviewBusy){exportPreviewAgain=true;return;}exportPreviewBusy=true;exportPreviewAgain=false;\r\n  clearTimeout(exportPreviewTimer);const serial=++exportPreviewSerial;$(&#039;exportScene&#039;).disabled=true;$(&#039;exportEncodedInfo&#039;).textContent=&#039;\u6b63\u5728\u7f16\u7801\u9884\u89c8\uff0c\u6587\u4ef6\u5927\u5c0f\u4ee5\u5b9e\u9645\u7ed3\u679c\u4e3a\u51c6\u2026&#039;;\r\n  try{const options=exportOptions();if(options.advanced&amp;&amp;creativeBoot.capabilities.advancedExport!==true)throw Error(&#039;\u5f53\u524d\u8bbe\u7f6e\u9700\u8981\u4f1a\u5458\u9ad8\u7ea7\u5bfc\u51fa\u3002\u8bf7\u5173\u95ed\u4f1a\u5458\u9ad8\u6e05\uff0c\u5e76\u5c06\u8d28\u91cf\u8bbe\u4e3a90\u6216\u4ee5\u4e0b\u3002&#039;);\r\n    const key=exportKey(options),result=await renderExportResult(options);if(serial!==exportPreviewSerial||key!==exportKey(exportOptions())||!$(&#039;exportDialog&#039;).open)return;exportCached={key,result};showExportResult(result);\r\n  }catch(error){if(serial!==exportPreviewSerial)return;$(&#039;exportPreview&#039;).hidden=true;$(&#039;exportEncodedInfo&#039;).textContent=error.message||&#039;\u9884\u89c8\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\u3002&#039;;}\r\n  finally{exportPreviewBusy=false;if(exportPreviewAgain&amp;&amp;$(&#039;exportDialog&#039;).open){exportPreviewAgain=false;exportPreviewTimer=setTimeout(refreshExportPreview,0);}}\r\n}\r\nasync function exportOne(layerOnly){\r\n  if(!await requireAccess(&#039;basicExport&#039;))return;\r\n  let options;try{options=exportOptions(layerOnly);}catch(error){show(error.message,true);return;}\r\n  if(options.advanced&amp;&amp;!await requireAccess(&#039;advancedExport&#039;))return;\r\n  await run(async()=&gt;{const key=exportKey(options),result=exportCached?.key===key?exportCached.result:await renderExportResult(options);\r\n    if(key!==exportKey(exportOptions(layerOnly)))throw Error(&#039;\u7f16\u8f91\u6216\u5bfc\u51fa\u8bbe\u7f6e\u5df2\u6539\u53d8\uff0c\u8bf7\u91cd\u65b0\u751f\u6210\u9884\u89c8\u540e\u4e0b\u8f7d\u3002&#039;);\r\n    showExportResult(result);if(!result.targetMet)throw Error(&#039;\u65e0\u6cd5\u5728\u5f53\u524d\u50cf\u7d20\u5c3a\u5bf8\u4e0b\u8fbe\u5230\u76ee\u6807\u5927\u5c0f\uff0c\u8bf7\u63d0\u9ad8\u76ee\u6807KB\u6216\u6539\u7528\u6309\u8d28\u91cf\u5bfc\u51fa\u3002&#039;);\r\n    if(fontTaskBusy||missingSiteFonts(layerOnly).length)throw Error(&#039;\u8bf7\u5148\u5b8c\u6210\u672c\u7ad9\u5b57\u4f53\u52a0\u8f7d\u6216\u6062\u590d\u3002&#039;);\r\n    download(result.blob,C.filename($(&#039;exportName&#039;).value||projectName,options.format===&#039;jpeg&#039;?&#039;jpg&#039;:options.format));$(&#039;exportDialog&#039;).close();show(&#039;\u5df2\u5bfc\u51fa &#039;+result.width+&#039; \u00d7 &#039;+result.height+&#039; px\uff0c&#039;+encodedSize(result.blob.size)+&#039;\u3002&#039;);\r\n  });\r\n}\r\nasync function batchExport(){if(!await requireAccess(&#039;advancedExport&#039;))return;await run(async()=&gt;{const images=scene.layers.filter(l=&gt;l.type===&#039;image&#039;);if(!images.length)throw Error(&#039;\u8bf7\u5148\u6dfb\u52a0\u56fe\u7247\u3002&#039;);const w=Number($(&#039;batchW&#039;).value),h=Number($(&#039;batchH&#039;).value),up=$(&#039;batchUpscale&#039;).checked,format=$(&#039;batchFormat&#039;).value,quality=Number($(&#039;batchQuality&#039;).value)\/100;const entries=[];let bytes=0;for(let i=0;i&lt;images.length;i++){const l=images[i],image=l.id===selected&amp;&amp;adjusted?adjusted:l.image;let ratio=Math.min(w&gt;0?w\/image.width:Infinity,h&gt;0?h\/image.height:Infinity);if(!Number.isFinite(ratio))ratio=1;if(!up)ratio=Math.min(1,ratio);const target=C.resize(image,Math.max(1,Math.round(image.width*ratio)),Math.max(1,Math.round(image.height*ratio)));const blob=await C.encode(target,{format,quality,background:&#039;#ffffff&#039;});bytes+=blob.size;if(bytes&gt;100000000)throw Error(&#039;\u538b\u7f29\u5305\u8fc7\u5927\uff0c\u8bf7\u51cf\u5c11\u56fe\u7247\u6570\u91cf\u6216\u964d\u4f4e\u5c3a\u5bf8\u3002&#039;);entries.push({name:C.filename(String(i+1).padStart(2,&#039;0&#039;)+&#039;-&#039;+l.name,format===&#039;jpeg&#039;?&#039;jpg&#039;:format),blob});show(&#039;\u6b63\u5728\u5904\u7406 &#039;+(i+1)+&#039; \/ &#039;+images.length+&#039;\u2026&#039;);}download(await zipEntries(entries),&#039;\u95ea\u5f97\u7d20\u6750-\u6279\u91cf\u56fe\u7247.zip&#039;);$(&#039;batchDialog&#039;).close();show(&#039;\u5df2\u5bfc\u51fa&#039;+images.length+&#039;\u5f20\u56fe\u7247\u3002&#039;);});}\r\nasync function zipEntries(entries){if(!window.JSZip)throw Error(&#039;ZIP\u7ec4\u4ef6\u8bfb\u53d6\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u91cd\u8bd5\u3002&#039;);const zip=new JSZip();for(const e of entries)zip.file(e.name,await e.blob.arrayBuffer());return zip.generateAsync({type:&#039;blob&#039;,compression:&#039;STORE&#039;});}\r\n\/* SD_GRID_SLICES_V1 \u2014 reuses ShandeImageCore.splitGrid and the existing selection queue. *\/\r\nfunction gridSlicePlan(width,height,rows,columns,maxPieces=30){\r\n  if(![width,height,rows,columns].every(Number.isInteger)||width&lt;1||height&lt;1||rows&lt;1||columns&lt;1||rows&gt;12||columns&gt;12)throw Error(&#039;\u8bf7\u8f93\u5165 1 \u5230 12 \u7684\u6574\u6570\u884c\u6570\u548c\u5217\u6570\u3002&#039;);\r\n  if(rows&gt;height||columns&gt;width)throw Error(&#039;\u5207\u7247\u884c\u5217\u6570\u4e0d\u80fd\u8d85\u8fc7\u6765\u6e90\u56fe\u7247\u7684\u50cf\u7d20\u5c3a\u5bf8\u3002&#039;);\r\n  if(rows*columns&gt;maxPieces)throw Error(&#039;\u4e00\u6b21\u6700\u591a\u751f\u6210 &#039;+maxPieces+&#039; \u7247\uff0c\u8bf7\u51cf\u5c11\u884c\u5217\u6570\u3002&#039;);\r\n  const cells=[];\r\n  for(let row=0;row&lt;rows;row++)for(let column=0;column&lt;columns;column++){\r\n    const x=Math.floor(column*width\/columns),right=Math.floor((column+1)*width\/columns),y=Math.floor(row*height\/rows),bottom=Math.floor((row+1)*height\/rows);\r\n    cells.push({row,column,x,y,width:right-x,height:bottom-y});\r\n  }\r\n  return cells;\r\n}\r\nfunction gridSourceInfo(){\r\n  if($(&#039;splitSource&#039;).value===&#039;canvas&#039;){\r\n    if(!scene.layers.length&amp;&amp;!scene.canvasFixed)throw Error(&#039;\u8bf7\u5148\u6253\u5f00\u56fe\u7247\u6216\u65b0\u5efa\u753b\u5e03\u3002&#039;);\r\n    return{kind:&#039;canvas&#039;,name:&#039;\u5f53\u524d\u753b\u5e03&#039;,width:scene.width,height:scene.height,layer:null};\r\n  }\r\n  const layer=imageLayer();\r\n  return{kind:&#039;layer&#039;,name:layer.name,width:layer.image.width,height:layer.image.height,layer};\r\n}\r\nfunction gridControlsPlan(){const source=gridSourceInfo(),rows=Number($(&#039;splitRows&#039;).value),columns=Number($(&#039;splitCols&#039;).value);return{source,rows,columns,cells:gridSlicePlan(source.width,source.height,rows,columns,C.LIMITS.maxSelectionPieces)};}\r\nfunction gridCapacityError(plan){\r\n  const count=cutQueue.length+plan.cells.length,pixels=cutQueue.reduce((n,p)=&gt;n+p.width*p.height,0)+plan.source.width*plan.source.height;\r\n  if(count&gt;C.LIMITS.maxSelectionPieces)return &#039;\u6e05\u5355\u5df2\u6709 &#039;+cutQueue.length+&#039; \u7247\uff0c\u518d\u52a0\u5165 &#039;+plan.cells.length+&#039; \u7247\u4f1a\u8d85\u8fc7 30 \u7247\u3002\u8bf7\u5148\u4e0b\u8f7d\u5e76\u6e05\u7406\u90e8\u5206\u5207\u7247\u3002&#039;;\r\n  if(pixels&gt;C.LIMITS.maxSelectionPixels)return &#039;\u5207\u7247\u6e05\u5355\u5408\u8ba1\u4e0d\u80fd\u8d85\u8fc7 1600 \u4e07\u50cf\u7d20\u3002\u8bf7\u5148\u7f29\u5c0f\u6765\u6e90\u56fe\u7247\uff0c\u6216\u4e0b\u8f7d\u5e76\u6e05\u7406\u5df2\u6709\u5207\u7247\u3002&#039;;\r\n  return &#039;&#039;;\r\n}\r\nfunction syncGridControls(){\r\n  if(!$(&#039;splitSource&#039;))return;\r\n  const preset=$(&#039;splitPreset&#039;).value;\r\n  $(&#039;splitRows&#039;).disabled=preset===&#039;1xn&#039;;$(&#039;splitCols&#039;).disabled=preset===&#039;nx1&#039;;\r\n  try{\r\n    const source=gridSourceInfo();\r\n    $(&#039;splitSourceInfo&#039;).textContent=source.name+&#039; \u00b7 &#039;+source.width+&#039; \u00d7 &#039;+source.height+&#039; px\u3002&#039;+(source.kind===&#039;layer&#039;?&#039;\u6309\u8fd9\u5f20\u56fe\u7247\u7684\u50cf\u7d20\u5207\u5206\uff0c\u4e0d\u5305\u542b\u753b\u5e03\u4e2d\u7684\u4f4d\u7f6e\u3001\u7f29\u653e\u3001\u65cb\u8f6c\u6216\u5176\u4ed6\u56fe\u5c42\u3002&#039;:&#039;\u5305\u542b\u6240\u6709\u53ef\u89c1\u56fe\u5c42\u3001\u6392\u7248\u6548\u679c\u548c\u80cc\u666f\uff0c\u6309\u753b\u5e03\u50cf\u7d20\u5207\u5206\u3002&#039;);\r\n    const plan=gridControlsPlan();$(&#039;splitExport&#039;).disabled=!!gridCapacityError(plan);\r\n  }catch(error){$(&#039;splitSourceInfo&#039;).textContent=error.message||String(error);$(&#039;splitExport&#039;).disabled=true;}\r\n}\r\nfunction refreshGridPreview(){\r\n  if(!$(&#039;gridDetails&#039;)?.open||workspaceMode!==&#039;selection&#039;)return;\r\n  syncGridControls();\r\n  const preview=$(&#039;splitPreview&#039;),ctx=preview.getContext(&#039;2d&#039;);\r\n  ctx.clearRect(0,0,preview.width,preview.height);preview.hidden=true;\r\n  try{\r\n    const plan=gridControlsPlan(),source=plan.source,scale=Math.min(1,248\/source.width,180\/source.height),width=Math.max(1,Math.round(source.width*scale)),height=Math.max(1,Math.round(source.height*scale));\r\n    preview.width=width;preview.height=height;preview.hidden=false;\r\n    const rendered=source.kind===&#039;canvas&#039;?C.renderScene({...scene,layers:displayLayers(false)},{scale}):C.resize(adjusted||source.layer.image,width,height);\r\n    try{ctx.drawImage(rendered,0,0,width,height);}finally{C.release(rendered);}\r\n    const sx=width\/source.width,sy=height\/source.height;\r\n    ctx.textAlign=&#039;center&#039;;ctx.textBaseline=&#039;middle&#039;;ctx.font=&#039;bold 11px sans-serif&#039;;ctx.lineWidth=1;\r\n    for(let i=0;i&lt;plan.cells.length;i++){\r\n      const cell=plan.cells[i],x=cell.x*sx,y=cell.y*sy,w=cell.width*sx,h=cell.height*sy;\r\n      ctx.strokeStyle=&#039;#2468eb&#039;;ctx.strokeRect(x+.5,y+.5,Math.max(0,w-1),Math.max(0,h-1));\r\n      const label=String(nextCutId+i).padStart(2,&#039;0&#039;),bw=Math.min(w,Math.max(21,ctx.measureText(label).width+8)),bh=Math.min(h,18);\r\n      ctx.fillStyle=&#039;#17345ae8&#039;;ctx.fillRect(x+(w-bw)\/2,y+(h-bh)\/2,bw,bh);ctx.fillStyle=&#039;#fff&#039;;ctx.save();ctx.beginPath();ctx.rect(x,y,w,h);ctx.clip();ctx.fillText(label,x+w\/2,y+h\/2);ctx.restore();\r\n    }\r\n    const widths=plan.cells.map(p=&gt;p.width),heights=plan.cells.map(p=&gt;p.height),range=values=&gt;Math.min(...values)===Math.max(...values)?String(values[0]):Math.min(...values)+&#039;\u2013&#039;+Math.max(...values);\r\n    const warning=gridCapacityError(plan);\r\n    $(&#039;splitPreviewInfo&#039;).textContent=(warning?warning+&#039; &#039;:&#039;&#039;)+plan.rows+&#039; \u884c \u00d7 &#039;+plan.columns+&#039; \u5217\uff0c\u5171 &#039;+plan.cells.length+&#039; \u7247\uff1b\u5355\u7247 &#039;+range(widths)+&#039; \u00d7 &#039;+range(heights)+&#039; px\u3002\u7f16\u53f7\u4ece\u5de6\u5230\u53f3\u3001\u4ece\u4e0a\u5230\u4e0b\u3002&#039;;\r\n    preview.setAttribute(&#039;aria-label&#039;,source.name+&#039;\uff0c&#039;+plan.rows+&#039;\u884c&#039;+plan.columns+&#039;\u5217\uff0c\u6309\u884c\u7f16\u53f7&#039;+nextCutId+&#039;\u81f3&#039;+(nextCutId+plan.cells.length-1));\r\n  }catch(error){$(&#039;splitPreviewInfo&#039;).textContent=error.message||String(error);$(&#039;splitExport&#039;).disabled=true;}\r\n}\r\nfunction applyGridPreset(){\r\n  const preset=$(&#039;splitPreset&#039;).value;\r\n  if(preset===&#039;2x2&#039;||preset===&#039;3x3&#039;){$(&#039;splitRows&#039;).value=$(&#039;splitCols&#039;).value=preset[0];}\r\n  if(preset===&#039;1xn&#039;){$(&#039;splitRows&#039;).value=&#039;1&#039;;if(Number($(&#039;splitCols&#039;).value)&lt;2)$(&#039;splitCols&#039;).value=&#039;3&#039;;}\r\n  if(preset===&#039;nx1&#039;){$(&#039;splitCols&#039;).value=&#039;1&#039;;if(Number($(&#039;splitRows&#039;).value)&lt;2)$(&#039;splitRows&#039;).value=&#039;3&#039;;}\r\n  syncGridControls();refreshGridPreview();\r\n}\r\nasync function splitExport(){\r\n  if(!await requireAccess(&#039;advancedExport&#039;))return;\r\n  await run(async()=&gt;{\r\n    if(adjusted)throw Error(&#039;\u8bf7\u5148\u5e94\u7528\u6216\u91cd\u7f6e\u8c03\u8272\uff0c\u518d\u751f\u6210\u89c4\u5219\u5207\u7247\u3002&#039;);\r\n    const plan=gridControlsPlan(),warning=gridCapacityError(plan);if(warning)throw Error(warning);\r\n    if(plan.source.kind===&#039;canvas&#039;&amp;&amp;typeof missingSiteFonts===&#039;function&#039;&amp;&amp;(fontTaskBusy||missingSiteFonts().length))throw Error(&#039;\u8bf7\u5148\u5728\u6587\u5b57\u9762\u677f\u6062\u590d\u6216\u5b8c\u6210\u52a0\u8f7d\u672c\u7ad9\u5b57\u4f53\uff0c\u518d\u751f\u6210\u753b\u5e03\u5207\u7247\u3002&#039;);\r\n    let rendered=null,parts=[];const prepared=[];\r\n    try{\r\n      const source=plan.source.kind===&#039;canvas&#039;?(rendered=C.renderScene({...scene,layers:displayLayers(false)},{scale:1})):plan.source.layer.image;\r\n      parts=C.splitGrid(source,{rows:plan.rows,cols:plan.columns});\r\n      parts.forEach((canvas,index)=&gt;{\r\n        const cell=plan.cells[index],id=nextCutId+index;\r\n        prepared.push({id,canvas,width:canvas.width,height:canvas.height,pixels:canvas.width*canvas.height,padding:0,name:C.filename(String(id).padStart(3,&#039;0&#039;)+&#039;-&#039;+plan.source.name+&#039;-\u7f51\u683c-r&#039;+(cell.row+1)+&#039;-c&#039;+(cell.column+1),&#039;png&#039;),sourceName:plan.source.name+&#039; \u00b7 \u7b2c &#039;+(cell.row+1)+&#039; \u884c\uff0c\u7b2c &#039;+(cell.column+1)+&#039; \u5217&#039;,bounds:{x:cell.x,y:cell.y,width:cell.width,height:cell.height},gridInfo:{row:cell.row,column:cell.column}});\r\n      });\r\n      C.selectionQueueInfo([...cutQueue,...prepared]);\r\n      releaseCutFuture();cutQueue.push(...prepared);nextCutId+=prepared.length;parts=[];\r\n      selection=null;lastSelectionQueued=false;lastQueuedCutId=null;markChanged();renderCuts();syncInspector();draw();\r\n      show(&#039;\u5df2\u751f\u6210 &#039;+prepared.length+&#039; \u7247\uff0c\u52a0\u5165\u4e0b\u65b9\u6e05\u5355\u3002\u53ef\u5355\u5f20\u4e0b\u8f7d PNG\uff0c\u6216\u4f7f\u7528\u201c\u6253\u5305\u4e0b\u8f7d ZIP\u201d\u5bfc\u51fa\u5168\u90e8\u3002\u6765\u6e90\u4fdd\u6301\u4e0d\u53d8\u3002&#039;);\r\n    }finally{parts.forEach(canvas=&gt;C.release(canvas));if(rendered)C.release(rendered);}\r\n  });\r\n}\r\n$(&#039;splitPreset&#039;).addEventListener(&#039;change&#039;,applyGridPreset);\r\n$(&#039;splitSource&#039;).addEventListener(&#039;change&#039;,()=&gt;{syncGridControls();refreshGridPreview();});\r\n[&#039;splitRows&#039;,&#039;splitCols&#039;].forEach(id=&gt;$(id).addEventListener(&#039;input&#039;,()=&gt;{if(![&#039;1xn&#039;,&#039;nx1&#039;].includes($(&#039;splitPreset&#039;).value))$(&#039;splitPreset&#039;).value=&#039;custom&#039;;refreshGridPreview();}));\r\n$(&#039;gridDetails&#039;).addEventListener(&#039;toggle&#039;,()=&gt;{syncGridControls();refreshGridPreview();});\r\n\r\n\/\/ Editable collage implementation is in the design workspace helpers below.\r\nfunction serializeProject(){const layers=scene.layers.map(l=&gt;{const a={...l};delete a.canvas;delete a.baseline;delete a.original;if(l.type===&#039;image&#039;){a.image=l.image.toDataURL(&#039;image\/png&#039;);if(l.original){const originalData=l.original.toDataURL(&#039;image\/png&#039;);if(originalData!==a.image)a.originalImage=originalData;}}return a;});const selections=cutQueue.map(piece=&gt;({name:piece.name,sourceName:piece.sourceName,padding:piece.padding,image:piece.canvas.toDataURL(&#039;image\/png&#039;)}));const text=JSON.stringify({type:&#039;shande-image-workspace&#039;,version:&#039;V3.0&#039;,schemaVersion:PROJECT_SCHEMA,name:projectName,projectId,createdAt:projectCreatedAt,updatedAt:Date.now(),width:scene.width,height:scene.height,background:scene.background,canvasFixed:scene.canvasFixed,selectedLayerIndex:scene.layers.findIndex(l=&gt;l.id===selected),layers,selections});if(text.length&gt;100000000)throw Error(&#039;\u9879\u76ee\u6587\u4ef6\u8fc7\u5927\uff0c\u8bf7\u51cf\u5c11\u56fe\u7247\u6216\u7f29\u5c0f\u5c3a\u5bf8\u3002&#039;);return text;}\r\nasync function saveProject(){if(!await requireAccess(&#039;localDraft&#039;))return;await run(async()=&gt;{const revision=editRevision,text=serializeProject(),blob=new Blob([text],{type:&#039;application\/json&#039;}),name=C.filename(projectName+&#039;-\u9879\u76ee&#039;,&#039;json&#039;);if(typeof hostDownloadConfirmed===&#039;function&#039;)await hostDownloadConfirmed(blob,name);else download(blob,name);if(editRevision===revision)setDirty(false);setProjectStatus(dirty?&#039;\u6709\u672a\u4fdd\u5b58\u7684\u66f4\u6539&#039;:&#039;\u9879\u76ee\u6587\u4ef6\u5df2\u51c6\u5907&#039;);show(&#039;\u9879\u76ee\u6587\u4ef6\u5df2\u51c6\u5907\uff0c\u5305\u542b\u56fe\u5c42\u4e0e&#039;+cutQueue.length+&#039;\u4e2a\u5708\u9009\u5207\u7247\u3002\u8bf7\u5b8c\u6210\u4e0b\u8f7d\u4ee5\u4fdd\u7559\u9879\u76ee\u3002&#039;);});}\r\nfunction migrateProjectData(data){\r\n  if(!data||typeof data!==&#039;object&#039;||Array.isArray(data)||data.type!==&#039;shande-image-workspace&#039;||!Array.isArray(data.layers)||data.layers.length&gt;50)throw Error(&#039;\u4e0d\u662f\u6709\u6548\u7684\u95ea\u5f97\u56fe\u7247\u9879\u76ee\u3002&#039;);\r\n  const version=data.version===undefined?&#039;V1.0&#039;:String(data.version),match=\/^V?([1-9]\\d*)(?:\\.(\\d+))?(?:\\.(\\d+))?$\/.exec(version);\r\n  if(!match||Number(match[1])&gt;3||(Number(match[1])===3&amp;&amp;(Number(match[2]||0)&gt;0||Number(match[3]||0)&gt;0)))throw Error(&#039;\u6b64\u9879\u76ee\u6765\u81ea\u66f4\u65b0\u6216\u4e0d\u652f\u6301\u7684\u7248\u672c\uff0c\u8bf7\u4f7f\u7528\u76f8\u5e94\u7248\u672c\u5de5\u4f5c\u53f0\u6253\u5f00\u3002&#039;);\r\n  if(data.schemaVersion!==undefined&amp;&amp;(!Number.isInteger(data.schemaVersion)||data.schemaVersion&lt;1||data.schemaVersion&gt;PROJECT_SCHEMA))throw Error(&#039;\u9879\u76ee\u6570\u636e\u7248\u672c\u4e0d\u53d7\u652f\u6301\uff0c\u8bf7\u66f4\u65b0\u5de5\u4f5c\u53f0\u540e\u91cd\u8bd5\u3002&#039;);\r\n  return {...data,name:cleanProjectName(data.name),projectId:\/^p_[A-Za-z0-9_-]{1,100}$\/.test(data.projectId||&#039;&#039;)?data.projectId:makeProjectId(),createdAt:Number.isFinite(data.createdAt)&amp;&amp;data.createdAt&gt;0?data.createdAt:Date.now()};\r\n}\r\nfunction restoreLayerFlags(source,layer){\r\n  layer.locked=source.locked===true;\r\n  if(source.groupId!==undefined&amp;&amp;source.groupId!==null&amp;&amp;!\/^g_[A-Za-z0-9_-]{1,80}$\/.test(source.groupId))throw Error(&#039;\u9879\u76ee\u56fe\u5c42\u5206\u7ec4\u6807\u8bc6\u65e0\u6548\u3002&#039;);\r\n  layer.groupId=source.groupId||null;\r\n  if(source.type===&#039;image&#039;&amp;&amp;source.frameCrop!==undefined&amp;&amp;source.frameCrop!==null){\r\n    const f=source.frameCrop;if(!f||![&#039;cover&#039;,&#039;contain&#039;].includes(f.fit)||!Number.isFinite(f.offsetX)||!Number.isFinite(f.offsetY)||f.offsetX&lt;0||f.offsetX&gt;1||f.offsetY&lt;0||f.offsetY&gt;1||!Number.isFinite(f.radius)||f.radius&lt;0||f.radius&gt;200||!Number.isFinite(f.zoom??1)||(f.zoom??1)&lt;1||(f.zoom??1)&gt;3)throw Error(&#039;\u9879\u76ee\u56fe\u7247\u76f8\u6846\u53c2\u6570\u65e0\u6548\u3002&#039;);\r\n    layer.frameCrop={fit:f.fit,offsetX:f.offsetX,offsetY:f.offsetY,zoom:f.zoom??1,radius:f.radius};\r\n  }\r\n}\r\nasync function decodeDataUrl(url){if(typeof url!==&#039;string&#039;||!\/^data:image\\\/png;base64,[a-zA-Z0-9+\/=]+$\/.test(url))throw Error(&#039;\u9879\u76ee\u4e2d\u542b\u6709\u4e0d\u652f\u6301\u7684\u56fe\u7247\u6570\u636e\u3002&#039;);const decoded=atob(url.slice(url.indexOf(&#039;,&#039;)+1));if(decoded.length&gt;40000000)throw Error(&#039;\u9879\u76ee\u4e2d\u6709\u56fe\u7247\u8d85\u8fc740MB\u3002&#039;);const bytes=new Uint8Array(decoded.length);for(let i=0;i&lt;bytes.length;i++)bytes[i]=decoded.charCodeAt(i);return C.loadFile(new File([bytes],&#039;\u9879\u76ee\u56fe\u7247.png&#039;,{type:&#039;image\/png&#039;}));}\r\nasync function loadProject(file,restoringDraft=false){if(!restoringDraft&amp;&amp;!await requireAccess(&#039;import&#039;))return false;let opened=false;await run(async()=&gt;{if(!file)return;if(file.size&gt;100000000)throw Error(&#039;\u9879\u76ee\u6587\u4ef6\u8d85\u8fc7100MB\u3002&#039;);const data=migrateProjectData(JSON.parse(await file.text()));const s=guardSize(data.width,data.height);let pixels=0,originalPixels=0,count=0;const layers=[];for(const source of data.layers){if(![&#039;image&#039;,&#039;text&#039;,&#039;shape&#039;].includes(source.type))throw Error(&#039;\u9879\u76ee\u56fe\u5c42\u7c7b\u578b\u65e0\u6548\u3002&#039;);const layer={id:nextId++,type:source.type,name:String(source.name||&#039;\u56fe\u5c42&#039;).slice(0,120),visible:source.visible!==false};restoreLayerFlags(source,layer);for(const key of [&#039;x&#039;,&#039;y&#039;,&#039;width&#039;,&#039;height&#039;,&#039;rotation&#039;,&#039;opacity&#039;,&#039;strokeWidth&#039;,&#039;shadowBlur&#039;,&#039;shadowOffsetX&#039;,&#039;shadowOffsetY&#039;]){const v=Number(source[key]??0);if(!Number.isFinite(v)||Math.abs(v)&gt;100000||([&#039;width&#039;,&#039;height&#039;].includes(key)&amp;&amp;v&lt;1))throw Error(&#039;\u9879\u76ee\u56fe\u5c42\u5c3a\u5bf8\u6216\u5750\u6807\u65e0\u6548\u3002&#039;);layer[key]=v;}layer.opacity=Math.max(0,Math.min(1,layer.opacity));layer.strokeWidth=Math.max(0,Math.min(40,layer.strokeWidth));layer.shadowBlur=Math.max(0,Math.min(100,layer.shadowBlur));layer.shadowOffsetX=Math.max(-100,Math.min(100,layer.shadowOffsetX));layer.shadowOffsetY=Math.max(-100,Math.min(100,layer.shadowOffsetY));layer.rotation=Math.max(-360,Math.min(360,layer.rotation));for(const key of [&#039;color&#039;,&#039;strokeColor&#039;,&#039;shadowColor&#039;])layer[key]=\/^#[0-9a-f]{6}$\/i.test(source[key]||&#039;&#039;)?source[key]:&#039;#000000&#039;;if(source.type===&#039;image&#039;){if(++count&gt;MAX_IMAGES)throw Error(&#039;\u9879\u76ee\u6700\u591a20\u5f20\u56fe\u7247\u3002&#039;);layer.image=await decodeDataUrl(source.image);pixels+=layer.image.width*layer.image.height;if(pixels&gt;MAX_ASSET_PIXELS)throw Error(&#039;\u9879\u76ee\u56fe\u7247\u603b\u50cf\u7d20\u8d85\u8fc73200\u4e07\u3002&#039;);layer.canvas=layer.image;layer.baseline=cloneCanvas(layer.image);layer.original=source.originalImage?await decodeDataUrl(source.originalImage):cloneCanvas(layer.image);originalPixels+=layer.original.width*layer.original.height;if(originalPixels&gt;MAX_ASSET_PIXELS)throw Error(&#039;\u9879\u76ee\u4fdd\u7559\u539f\u56fe\u603b\u50cf\u7d20\u8d85\u8fc73200\u4e07\u3002&#039;);}else if(source.type===&#039;shape&#039;){if(![&#039;rect&#039;,&#039;roundrect&#039;,&#039;ellipse&#039;,&#039;triangle&#039;,&#039;line&#039;,&#039;arrow&#039;].includes(source.shape))throw Error(&#039;\u9879\u76ee\u5f62\u72b6\u7c7b\u578b\u65e0\u6548\u3002&#039;);layer.shape=source.shape;layer.noFill=source.noFill===true;}else{layer.text=String(source.text||&#039;&#039;).slice(0,5000);layer.fontSize=Math.max(8,Math.min(500,Number(source.fontSize)||48));layer.fontRef=normalizeSiteFontRef(source.fontRef);if(source.fontRef&amp;&amp;!layer.fontRef)throw Error(&#039;\u9879\u76ee\u4e2d\u7684\u672c\u7ad9\u5b57\u4f53\u8bb0\u5f55\u65e0\u6548\u3002&#039;);layer.fontFamily=layer.fontRef?layer.fontRef.family:([&#039;sans-serif&#039;,&#039;serif&#039;,&#039;monospace&#039;].includes(source.fontFamily)?source.fontFamily:&#039;sans-serif&#039;);layer.fontWeight=source.fontWeight===&#039;bold&#039;?&#039;bold&#039;:&#039;normal&#039;;layer.align=[&#039;left&#039;,&#039;center&#039;,&#039;right&#039;].includes(source.align)?source.align:&#039;left&#039;;layer.lineHeight=Math.max(.8,Math.min(3,Number(source.lineHeight)||1.3));}layers.push(layer);}const restoredCuts=[];if(data.selections!==undefined){if(!Array.isArray(data.selections)||data.selections.length&gt;C.LIMITS.maxSelectionPieces)throw Error(&#039;\u9879\u76ee\u5708\u9009\u5207\u7247\u6570\u91cf\u65e0\u6548\u3002&#039;);try{for(const source of data.selections){const canvas=await decodeDataUrl(source.image);const piece={id:nextCutId++,canvas,width:canvas.width,height:canvas.height,pixels:canvas.width*canvas.height,name:String(source.name||&#039;\u5207\u7247&#039;).slice(0,120),sourceName:String(source.sourceName||&#039;\u9879\u76ee\u56fe\u7247&#039;).slice(0,120),padding:Math.max(0,Math.min(32,Math.round(Number(source.padding)||0)))};restoredCuts.push(piece);C.selectionQueueInfo(restoredCuts);}}catch(error){restoredCuts.forEach(piece=&gt;C.release(piece.canvas));throw error;}}if(!await confirmProjectReplacement()){restoredCuts.forEach(piece=&gt;C.release(piece.canvas));return;}releaseCuts();cutQueue=restoredCuts;history=[];future=[];renderCuts();scene.width=s.w;scene.height=s.h;scene.canvasFixed=data.canvasFixed!==false;scene.background=typeof data.background===&#039;string&#039;&amp;&amp;\/^#[0-9a-f]{6}$\/i.test(data.background)?data.background:null;scene.layers=layers;setProjectName(data.name);projectId=data.projectId;projectCreatedAt=data.createdAt;editRevision++;invalidateExportPreview();const selectedIndex=Number.isInteger(data.selectedLayerIndex)&amp;&amp;data.selectedLayerIndex&gt;=0&amp;&amp;data.selectedLayerIndex&lt;layers.length?data.selectedLayerIndex:layers.length-1;selected=layers.length?layers[selectedIndex].id:null;if(typeof normalizeCanvasSelection===&#039;function&#039;)normalizeCanvasSelection();selection=null;lastSelectionQueued=false;lastQueuedCutId=null;zoomLevel=null;resetAdjust(false);renderLayers();syncInspector();draw();hasLoadedExample=false;opened=true;setDirty(false);setProjectStatus(&#039;\u5df2\u6253\u5f00\u672c\u673a\u9879\u76ee&#039;);show(&#039;\u9879\u76ee\u5df2\u6253\u5f00\uff0c\u6062\u590d&#039;+cutQueue.length+&#039;\u4e2a\u5708\u9009\u5207\u7247\u3002&#039;);});$(&#039;projectInput&#039;).value=&#039;&#039;;return opened;}\r\n\r\nfunction selectionPadding(){return Math.max(0,Math.min(32,Math.round(Number($(&#039;selectionPadding&#039;).value)||0)));}\r\nfunction cutName(l,id){return String(id).padStart(3,&#039;0&#039;)+&#039;-&#039;+l.name+&#039;-\u5708\u9009&#039;;}\r\nfunction releaseCutFuture(){cutFuture.forEach(piece=&gt;C.release(piece.canvas));cutFuture=[];}\r\nfunction renderCuts(){\r\n  const box=$(&#039;selectionQueue&#039;);box.replaceChildren();$(&#039;cutCount&#039;).textContent=String(cutQueue.length);$(&#039;mobileCutCount&#039;).textContent=String(cutQueue.length);$(&#039;queueExport&#039;).disabled=!cutQueue.length;$(&#039;queueClear&#039;).disabled=!cutQueue.length&amp;&amp;!cutFuture.length;$(&#039;queueUndo&#039;).disabled=!cutQueue.length;$(&#039;queueRedo&#039;).disabled=!cutFuture.length;\r\n  if(!cutQueue.length){const empty=document.createElement(&#039;div&#039;);empty.className=&#039;queue-empty&#039;;empty.textContent=&#039;\u4f60\u7684\u5207\u7247\u4f1a\u51fa\u73b0\u5728\u8fd9\u91cc\\n\u5728\u753b\u5e03\u5708\u9009\uff0c\u6216\u5c55\u5f00\u89c4\u5219\u5207\u7247\u751f\u6210&#039;;box.append(empty);}\r\n  cutQueue.forEach(piece=&gt;{const card=document.createElement(&#039;div&#039;);card.className=&#039;queue-card&#039;;card.dataset.cutId=String(piece.id);const thumb=document.createElement(&#039;canvas&#039;);thumb.className=&#039;queue-thumb&#039;;thumb.width=96;thumb.height=76;const ctx=thumb.getContext(&#039;2d&#039;),ratio=Math.min(88\/piece.width,68\/piece.height);ctx.drawImage(piece.canvas,(96-piece.width*ratio)\/2,(76-piece.height*ratio)\/2,piece.width*ratio,piece.height*ratio);const meta=document.createElement(&#039;div&#039;);meta.className=&#039;queue-meta&#039;;const title=document.createElement(&#039;input&#039;);title.className=&#039;queue-name&#039;;title.value=piece.name.replace(\/\\.png$\/i,&#039;&#039;);title.maxLength=100;title.setAttribute(&#039;aria-label&#039;,&#039;\u5207\u7247 &#039;+piece.id+&#039; \u540d\u79f0&#039;);const commitName=(normalize=false)=&gt;{const name=C.filename(title.value||&#039;\u5207\u7247 &#039;+piece.id,&#039;png&#039;);if(piece.name!==name){piece.name=name;markChanged();}if(normalize)title.value=name.replace(\/\\.png$\/i,&#039;&#039;);};title.addEventListener(&#039;input&#039;,()=&gt;commitName());title.addEventListener(&#039;change&#039;,()=&gt;commitName(true));title.addEventListener(&#039;blur&#039;,()=&gt;commitName(true));const size=document.createElement(&#039;span&#039;);size.textContent=piece.width+&#039; \u00d7 &#039;+piece.height+&#039; \u00b7 PNG&#039;;const source=document.createElement(&#039;small&#039;);source.textContent=piece.sourceName;meta.append(title,size,source);const actions=document.createElement(&#039;div&#039;);actions.className=&#039;queue-item-actions&#039;;const dl=document.createElement(&#039;button&#039;);dl.textContent=&#039;\u4e0b\u8f7dPNG&#039;;dl.dataset.downloadCut=String(piece.id);dl.addEventListener(&#039;click&#039;,()=&gt;downloadCut(piece));const remove=document.createElement(&#039;button&#039;);remove.textContent=&#039;\u5220\u9664&#039;;remove.className=&#039;danger&#039;;remove.dataset.removeCut=String(piece.id);remove.addEventListener(&#039;click&#039;,()=&gt;removeCut(piece.id));const inspect=document.createElement(&#039;button&#039;);inspect.textContent=&#039;\u9884\u89c8&#039;;inspect.addEventListener(&#039;click&#039;,()=&gt;previewCut(piece));actions.append(inspect,dl,remove);card.append(thumb,meta,actions);box.append(card);});updateHistory();refreshGridPreview();\r\n}\r\nfunction addCurrentCut(automatic=false){\r\n  try{const l=imageLayer();if(!selection)throw Error(&#039;\u8bf7\u5148\u7528\u81ea\u7531\u5957\u7d22\u3001\u5706\u5f62\u6216\u77e9\u5f62\u5708\u9009\u5143\u7d20\u3002&#039;);if(lastSelectionQueued){if(!automatic)show(&#039;\u8fd9\u4e2a\u9009\u533a\u5df2\u52a0\u5165\u5207\u7247\u6e05\u5355\uff0c\u53ef\u7ee7\u7eed\u5708\u4e0b\u4e00\u5904\u3002&#039;);return;}if(adjusted)throw Error(&#039;\u8bf7\u5148\u5e94\u7528\u6216\u91cd\u7f6e\u8c03\u8272\uff0c\u518d\u5708\u9009\u3002&#039;);const piece=C.createSelectionPiece(l.image,selection,cutName(l,nextCutId),cutQueue,{padding:selectionPadding()});piece.id=nextCutId++;piece.sourceName=l.name;releaseCutFuture();cutQueue.push(piece);markChanged();lastSelectionQueued=true;lastQueuedCutId=piece.id;renderCuts();syncInspector();show(&#039;\u5df2\u5708\u9009&#039;+cutQueue.length+&#039;\u5904\u3002\u539f\u56fe\u4fdd\u6301\u4e0d\u53d8\uff0c\u53ef\u7ee7\u7eed\u5708\u4e0b\u4e00\u5904\u3002&#039;);}catch(error){show(error.message||String(error),true);}\r\n}\r\nfunction undoCut(){if(!cutQueue.length||busy)return;cutFuture.push(cutQueue.pop());markChanged();lastSelectionQueued=false;lastQueuedCutId=null;selection=null;renderCuts();syncInspector();draw();show(&#039;\u5df2\u64a4\u9500\u4e0a\u4e00\u7247\u3002&#039;);}\r\nfunction redoCut(){if(!cutFuture.length||busy)return;const piece=cutFuture[cutFuture.length-1];C.selectionQueueInfo([...cutQueue,piece]);cutQueue.push(cutFuture.pop());markChanged();renderCuts();syncInspector();show(&#039;\u5df2\u6062\u590d\u4e0a\u4e00\u7247\u3002&#039;);}\r\nfunction removeCut(id){if(busy)return;const index=cutQueue.findIndex(piece=&gt;piece.id===id);if(index&lt;0)return;releaseCutFuture();const piece=cutQueue.splice(index,1)[0];markChanged();C.release(piece.canvas);if(lastQueuedCutId===id){lastSelectionQueued=false;lastQueuedCutId=null;}renderCuts();syncInspector();show(&#039;\u5df2\u5220\u9664\u5207\u7247\u3002\u539f\u56fe\u4ecd\u4fdd\u7559\u3002&#039;);}\r\nfunction releaseCuts(){cutQueue.forEach(piece=&gt;C.release(piece.canvas));cutQueue=[];releaseCutFuture();lastSelectionQueued=false;lastQueuedCutId=null;selection=null;}\r\nfunction clearCuts(){if(busy)return;markChanged();releaseCuts();renderCuts();syncInspector();draw();show(&#039;\u5207\u7247\u6e05\u5355\u5df2\u6e05\u7a7a\u3002\u539f\u56fe\u548c\u753b\u5e03\u4ecd\u4fdd\u7559\u3002&#039;);}\r\nasync function encodeSingleCut(canvas){const scale=creativeBoot.capabilities.advancedExport===true?1:Math.min(1,2048\/canvas.width,2048\/canvas.height),out=scale&lt;1?C.resize(canvas,Math.max(1,Math.round(canvas.width*scale)),Math.max(1,Math.round(canvas.height*scale))):canvas;try{return await C.encode(out,{format:&#039;png&#039;});}finally{if(out!==canvas)C.release(out);}}\r\nasync function downloadCurrentSelection(){if(!await requireAccess(&#039;basicExport&#039;))return;await run(async()=&gt;{const l=imageLayer();if(!selection)throw Error(&#039;\u8bf7\u5148\u5708\u9009\u4e00\u4e2a\u5143\u7d20\u3002&#039;);if(adjusted)throw Error(&#039;\u8bf7\u5148\u5e94\u7528\u6216\u91cd\u7f6e\u8c03\u8272\u3002&#039;);const piece=C.createSelectionPiece(l.image,selection,&#039;\u5f53\u524d\u9009\u533a&#039;,[],{padding:selectionPadding()});try{const blob=await encodeSingleCut(piece.canvas);download(blob,C.filename(cutName(l,nextCutId)+&#039;-\u5f53\u524d\u9009\u533a&#039;,&#039;png&#039;));show(creativeBoot.mode===&#039;member&#039;?&#039;\u5f53\u524d\u9009\u533a\u5df2\u5206\u5272\u4e3a\u900f\u660ePNG\uff0c\u4fdd\u6301\u539f\u56fe\u50cf\u7d20\u3002&#039;:&#039;\u5f53\u524d\u9009\u533a\u5df2\u5bfc\u51fa\u900f\u660ePNG\uff0c\u6700\u957f\u8fb9\u4e0d\u8d85\u8fc72048\u50cf\u7d20\u3002&#039;);}finally{C.release(piece.canvas);}});}\r\nasync function downloadCut(piece){if(!await requireAccess(&#039;basicExport&#039;))return;await run(async()=&gt;{if(!cutQueue.includes(piece))throw Error(&#039;\u5207\u7247\u5df2\u88ab\u79fb\u9664\u3002&#039;);download(await encodeSingleCut(piece.canvas),C.filename(piece.name,&#039;png&#039;));show(creativeBoot.mode===&#039;member&#039;?&#039;\u5207\u7247PNG\u5df2\u51c6\u5907\u597d\uff0c\u539f\u56fe\u5206\u8fa8\u7387\u4fdd\u6301\u4e0d\u53d8\u3002&#039;:&#039;\u5207\u7247PNG\u5df2\u51c6\u5907\u597d\uff0c\u6700\u957f\u8fb9\u4e0d\u8d85\u8fc72048\u50cf\u7d20\u3002&#039;);});}\r\nasync function downloadCutQueue(){if(!await requireAccess(&#039;advancedExport&#039;))return;await run(async()=&gt;{if(!cutQueue.length)throw Error(&#039;\u8bf7\u5148\u5708\u9009\u5143\u7d20\u6216\u751f\u6210\u89c4\u5219\u5207\u7247\u3002&#039;);const blob=await C.buildSelectionZip(cutQueue,{onProgress:(done,total)=&gt;show(&#039;\u6b63\u5728\u6253\u5305\u56fe\u7247\u5207\u7247 &#039;+done+&#039; \/ &#039;+total+&#039;\u2026&#039;)});download(blob,&#039;\u95ea\u5f97\u7d20\u6750-\u56fe\u7247\u5207\u7247.zip&#039;);show(&#039;\u5df2\u6253\u5305&#039;+cutQueue.length+&#039;\u4e2a\u72ec\u7acb PNG\uff1b\u900f\u660e\u533a\u57df\u6309\u6765\u6e90\u4fdd\u7559\u3002&#039;);});}\r\nlet drawerReturnFocus=null;\r\nfunction narrowWorkspace(){return typeof window.matchMedia===&#039;function&#039;&amp;&amp;window.matchMedia(&#039;(max-width:900px)&#039;).matches;}\r\nfunction openProperties(){const drawer=$(&#039;propertiesDrawer&#039;);drawer.classList.add(&#039;open&#039;);$(&#039;app&#039;).classList.add(&#039;properties-open&#039;);$(&#039;drawerBackdrop&#039;).hidden=false;$(&#039;mobilePropertiesToggle&#039;).setAttribute(&#039;aria-expanded&#039;,&#039;true&#039;);if(narrowWorkspace()){drawerReturnFocus=document.activeElement;drawer.setAttribute(&#039;role&#039;,&#039;dialog&#039;);drawer.setAttribute(&#039;aria-modal&#039;,&#039;true&#039;);$(&#039;propertiesClose&#039;).focus?.({preventScroll:true});requestAnimationFrame(()=&gt;window.dispatchEvent(new Event(&#039;resize&#039;)));}}\r\nfunction closeProperties(){const drawer=$(&#039;propertiesDrawer&#039;);drawer.classList.remove(&#039;open&#039;);$(&#039;app&#039;).classList.remove(&#039;properties-open&#039;);$(&#039;drawerBackdrop&#039;).hidden=true;$(&#039;mobilePropertiesToggle&#039;).setAttribute(&#039;aria-expanded&#039;,&#039;false&#039;);drawer.removeAttribute(&#039;role&#039;);drawer.removeAttribute(&#039;aria-modal&#039;);if(narrowWorkspace()&amp;&amp;drawerReturnFocus?.isConnected)drawerReturnFocus.focus?.({preventScroll:true});drawerReturnFocus=null;if(narrowWorkspace())requestAnimationFrame(()=&gt;window.dispatchEvent(new Event(&#039;resize&#039;)));}\r\ndocument.addEventListener(&#039;keydown&#039;,event=&gt;{\r\n  if(!narrowWorkspace()||!$(&#039;propertiesDrawer&#039;).classList.contains(&#039;open&#039;)||document.querySelector(&#039;dialog[open]&#039;))return;\r\n  if(event.key===&#039;Escape&#039;){event.preventDefault();closeProperties();return;}\r\n  if(event.key!==&#039;Tab&#039;)return;\r\n  const nodes=Array.from($(&#039;propertiesDrawer&#039;).querySelectorAll(&#039;button:not(:disabled),a[href],input:not(:disabled),select:not(:disabled),textarea:not(:disabled),summary&#039;)).filter(node=&gt;node.getClientRects().length);\r\n  if(!nodes.length)return;const first=nodes[0],last=nodes[nodes.length-1];\r\n  if(event.shiftKey&amp;&amp;document.activeElement===first){event.preventDefault();last.focus();}else if(!event.shiftKey&amp;&amp;document.activeElement===last){event.preventDefault();first.focus();}\r\n});\r\nwindow.addEventListener(&#039;resize&#039;,()=&gt;{if(!narrowWorkspace()&amp;&amp;$(&#039;propertiesDrawer&#039;).classList.contains(&#039;open&#039;))closeProperties();});\r\nfunction setMode(value){\r\n  workspaceMode=value;if(value!==&#039;color&#039;)resetAdjust(false);$(&#039;app&#039;).dataset.mode=value;const titles={selection:&#039;\u63d0\u53d6\u7d20\u6750&#039;,edit:&#039;\u57fa\u7840\u7f16\u8f91&#039;,color:&#039;\u8c03\u8272&#039;,text:&#039;\u6587\u5b57\u4e0e\u6c34\u5370&#039;,shape:&#039;\u5f62\u72b6\u4e0e\u6392\u7248&#039;,collage:&#039;\u62fc\u56fe\u6392\u7248&#039;,canvas:&#039;\u753b\u5e03\u8bbe\u7f6e&#039;,more:&#039;\u6279\u91cf\u4e0e\u6587\u4ef6&#039;};$(&#039;modeTitle&#039;).textContent=titles[value]||&#039;\u56fe\u7247\u7f16\u8f91&#039;;$(&#039;propertyTitle&#039;).textContent=value===&#039;selection&#039;?&#039;\u5207\u7247\u6e05\u5355&#039;:titles[value]||&#039;\u5de5\u5177\u5c5e\u6027&#039;;$(&#039;mobilePropertiesLabel&#039;).textContent=value===&#039;selection&#039;?&#039;\u5207\u7247&#039;:&#039;\u8bbe\u7f6e&#039;;$(&#039;mobileCutCount&#039;).hidden=value!==&#039;selection&#039;;document.querySelectorAll(&#039;[data-mode]&#039;).forEach(button=&gt;{if(button.id===&#039;app&#039;)return;button.classList.toggle(&#039;active&#039;,button.dataset.mode===value);button.setAttribute(&#039;aria-pressed&#039;,button.dataset.mode===value?&#039;true&#039;:&#039;false&#039;);});\r\n  [&#039;selectionPanel&#039;,&#039;tab-layer&#039;,&#039;tab-image&#039;,&#039;tab-canvas&#039;,&#039;collagePanel&#039;,&#039;morePanel&#039;].forEach(id=&gt;$(id).hidden=true);\r\n  const visible={selection:&#039;selectionPanel&#039;,edit:&#039;tab-image&#039;,color:&#039;tab-image&#039;,text:&#039;tab-layer&#039;,shape:&#039;tab-layer&#039;,collage:&#039;collagePanel&#039;,canvas:&#039;tab-canvas&#039;,more:&#039;morePanel&#039;}[value];if(visible)$(visible).hidden=false;$(&#039;shapePalette&#039;).hidden=value!==&#039;shape&#039;;$(&#039;addText&#039;).hidden=value===&#039;shape&#039;;document.querySelectorAll(&#039;[data-image-part]&#039;).forEach(part=&gt;part.hidden=value===&#039;color&#039;?part.dataset.imagePart!==&#039;color&#039;:part.dataset.imagePart===&#039;color&#039;);\r\n  if(value===&#039;selection&#039;)setTool(selectionTool);else setTool(&#039;move&#039;);if(value===&#039;more&#039;)$(&#039;toolHint&#039;).textContent=&#039;\u4fdd\u5b58\u672c\u673a\u9879\u76ee\uff0c\u6216\u7edf\u4e00\u5904\u7406\u56fe\u7247\u5c3a\u5bf8\u548c\u683c\u5f0f\u3002\u5708\u9009\u7ed3\u679c\u4f7f\u7528\u72ec\u7acb\u5207\u7247ZIP\u3002&#039;;if(value===&#039;color&#039;)$(&#039;toolHint&#039;).textContent=&#039;\u62d6\u52a8\u6ed1\u5757\u9884\u89c8\uff0c\u5e94\u7528\u540e\u751f\u6548\u3002\u8c03\u8272\u5904\u7406\u5f53\u524d\u56fe\u7247\uff0c\u4e0d\u5f71\u54cd\u5df2\u7ecf\u751f\u6210\u7684\u5207\u7247\u3002&#039;;if(value===&#039;text&#039;)$(&#039;toolHint&#039;).textContent=&#039;\u6dfb\u52a0\u6587\u5b57\u6216\u6c34\u5370\uff0c\u518d\u8c03\u6574\u4f4d\u7f6e\u3001\u5b57\u53f7\u548c\u6837\u5f0f\u3002&#039;;if(value===&#039;shape&#039;)$(&#039;toolHint&#039;).textContent=&#039;\u6dfb\u52a0\u53ef\u7f16\u8f91\u5f62\u72b6\uff0c\u62d6\u52a8\u6392\u7248\uff0c\u8c03\u6574\u989c\u8272\u3001\u5c3a\u5bf8\u548c\u63cf\u8fb9\u3002&#039;;updateHistory();\r\n}\r\nfunction applyZoom(){const canvas=$(&#039;stage&#039;);if(zoomLevel===null){const view=selectionViewport(),wrap=$(&#039;stageWrap&#039;),availableW=Math.max(120,(wrap.clientWidth||800)-32),availableH=Math.max(120,(wrap.clientHeight||520)-32),fit=Math.min(1,availableW\/view.width,availableH\/view.height);canvas.style.width=Math.max(1,Math.round(view.width*fit))+&#039;px&#039;;canvas.style.height=Math.max(1,Math.round(view.height*fit))+&#039;px&#039;;canvas.style.maxWidth=&#039;100%&#039;;canvas.style.maxHeight=&#039;100%&#039;;$(&#039;zoomValue&#039;).textContent=&#039;\u9002\u5e94&#039;;}else{const view=selectionViewport();canvas.style.width=Math.round(view.width*zoomLevel)+&#039;px&#039;;canvas.style.height=Math.round(view.height*zoomLevel)+&#039;px&#039;;canvas.style.maxWidth=&#039;none&#039;;canvas.style.maxHeight=&#039;none&#039;;$(&#039;zoomValue&#039;).textContent=Math.round(zoomLevel*100)+&#039;%&#039;;}}\r\nfunction zoomBy(factor){const rect=$(&#039;stage&#039;).getBoundingClientRect();const view=selectionViewport(),current=zoomLevel===null?(rect.width||$(&#039;stage&#039;).width)\/view.width:zoomLevel;zoomLevel=Math.max(.05,Math.min(4,current*factor));draw();}\r\n\r\n\/\/ Original V1.4 workspace improvements. Runs inside the editor closure.\r\nlet creativeBoot={mode:&#039;trial&#039;,capabilities:{}},hasLoadedExample=false,exportPreferencesTouched=false;\r\nfunction receiveCreativeBoot(value){\r\n  if(!value||typeof value!==&#039;object&#039;)return;\r\n  creativeBoot={mode:[&#039;member&#039;,&#039;basic&#039;].includes(value.mode)?value.mode:&#039;trial&#039;,expiresAt:Number(value.expiresAt)||0,status:String(value.status||&#039;trial&#039;),fontScope:String(value.fontScope||&#039;guest&#039;),canRetrieve:value.canRetrieve===true,capabilities:value.capabilities&amp;&amp;typeof value.capabilities===&#039;object&#039;?value.capabilities:{}};\r\n  const label=$(&#039;memberLabel&#039;),banner=$(&#039;memberBanner&#039;);banner.dataset.mode=creativeBoot.mode;\r\n  label.textContent=creativeBoot.status===&#039;unavailable&#039;?&#039;\u8d26\u6237\u72b6\u6001\u6682\u65f6\u65e0\u6cd5\u786e\u8ba4&#039;:creativeBoot.status===&#039;banned&#039;?&#039;\u6b64\u8d26\u6237\u7684\u521b\u4f5c\u6743\u76ca\u5df2\u505c\u7528&#039;:creativeBoot.mode===&#039;member&#039;?&#039;\u4f1a\u5458\u6709\u6548&#039;:creativeBoot.mode===&#039;basic&#039;?&#039;\u6ce8\u518c\u514d\u8d39&#039;:&#039;\u793a\u4f8b\u8bd5\u7528&#039;;$(&#039;membershipAction&#039;).textContent=creativeBoot.mode===&#039;trial&#039;?&#039;\u767b\u5f55 \/ \u6ce8\u518c&#039;:&#039;\u4f1a\u5458\u4e2d\u5fc3&#039;;if(!exportPreferencesTouched)$(&#039;exportHD&#039;).checked=creativeBoot.mode===&#039;member&#039;;\r\n  try{if(!value.brand?.logoUrl)throw Error();const url=new URL(value.brand.logoUrl,(window.SHANDE_IMAGE_WORKSPACE||{}).hostUrl||&#039;https:\/\/www.zipget.cn\/&#039;);const host=new URL((window.SHANDE_IMAGE_WORKSPACE||{}).hostUrl||&#039;https:\/\/www.zipget.cn\/&#039;);if(url.protocol===&#039;https:&#039;&amp;&amp;url.origin===host.origin&amp;&amp;!url.username&amp;&amp;!url.password){$(&#039;brandLogo&#039;).src=url.href;$(&#039;brandLogo&#039;).hidden=false;}}catch(_){}\r\n  if(creativeBoot.mode===&#039;trial&#039;&amp;&amp;!scene.layers.length&amp;&amp;!scene.canvasFixed&amp;&amp;!hasLoadedExample)loadExample();\r\n  if(draftCheckedScope&amp;&amp;draftCheckedScope!==creativeBoot.fontScope){clearTimeout(autoDraftTimer);draftChecked=false;draftPending=false;draftToken=null;autoDraftPaused=true;draftStatus(&#039;\u8d26\u6237\u5df2\u53d8\u5316\uff0c\u8bf7\u91cd\u65b0\u6253\u5f00\u5de5\u4f5c\u53f0\u540e\u4fdd\u5b58\u8349\u7a3f\u3002&#039;);}\r\n  else probeLocalDraftWhenReady();\r\n}\r\nasync function requireAccess(action){\r\n  try{\r\n    if(typeof requestHostOperation!==&#039;function&#039;){show(&#039;\u5f53\u524d\u662f\u793a\u4f8b\u8bd5\u7528\u3002\u8bf7\u4ece\u95ea\u5f97\u7d20\u6750\u7ad9\u514d\u8d39\u6ce8\u518c\u6216\u767b\u5f55\u540e\u4f7f\u7528\u81ea\u5df1\u7684\u6587\u4ef6\u3002&#039;,true);return false;}\r\n    const result=await requestHostOperation(&#039;authorize&#039;,{action});\r\n    if(result.boot)receiveCreativeBoot(result.boot);\r\n    if(result.allowed===true)return true;\r\n    show(result.message||(creativeBoot.mode===&#039;trial&#039;?&#039;\u514d\u8d39\u6ce8\u518c\u6216\u767b\u5f55\u540e\uff0c\u5373\u53ef\u5bfc\u5165\u56fe\u7247\u3001\u57fa\u7840\u7f16\u8f91\u548c\u5bfc\u51fa\u5355\u5f20\u56fe\u7247\u3002&#039;:&#039;\u6b64\u9879\u4e3a\u4f1a\u5458\u9ad8\u7ea7\u529f\u80fd\uff0c\u53ef\u5347\u7ea7\u4f1a\u5458\u540e\u4f7f\u7528\u3002\u5f53\u524d\u7f16\u8f91\u4f1a\u4fdd\u7559\u3002&#039;),true);return false;\r\n  }catch(error){show(error.message||&#039;\u4f1a\u5458\u72b6\u6001\u6682\u65f6\u65e0\u6cd5\u786e\u8ba4\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5\uff1b\u5f53\u524d\u7f16\u8f91\u5df2\u4fdd\u7559\u3002&#039;,true);return false;}\r\n}\r\nfunction loadExample(){\r\n  if(scene.layers.length){show(&#039;\u8bf7\u5148\u4fdd\u5b58\u5f53\u524d\u9879\u76ee\uff0c\u518d\u65b0\u5efa\u753b\u5e03\u4f53\u9a8c\u793a\u4f8b\u3002&#039;);return;}\r\n  const c=C.createCanvas(1200,900),x=c.getContext(&#039;2d&#039;);x.fillStyle=&#039;#f3f7ff&#039;;x.fillRect(0,0,1200,900);\r\n  const shapes=[{cx:245,cy:260,r:132,color:&#039;#849df3&#039;},{cx:910,cy:280,r:115,color:&#039;#dab0e9&#039;},{cx:910,cy:660,r:120,color:&#039;#87c8b0&#039;}];\r\n  shapes.forEach(s=&gt;{x.fillStyle=s.color;x.beginPath();x.arc(s.cx,s.cy,s.r,0,Math.PI*2);x.fill();x.fillStyle=&#039;#ffffff88&#039;;x.beginPath();x.arc(s.cx-28,s.cy-32,s.r*.38,0,Math.PI*2);x.fill();});\r\n  x.fillStyle=&#039;#ffd48c&#039;;x.save();x.translate(285,680);x.rotate(-.13);x.fillRect(-125,-82,250,164);x.restore();\r\n  x.fillStyle=&#039;#263852&#039;;x.font=&#039;bold 52px sans-serif&#039;;x.textAlign=&#039;center&#039;;x.fillText(&#039;\u628a\u7075\u611f\uff0c\u53d8\u6210\u4f5c\u54c1&#039;,600,475);x.fillStyle=&#039;#627696&#039;;x.font=&#039;28px sans-serif&#039;;x.fillText(&#039;\u5708\u9009\u4e00\u4e2a\u8272\u5757\uff0c\u8bd5\u8bd5\u900f\u660e\u5207\u7247&#039;,600,526);\r\n  scene.canvasFixed=false;scene.width=1200;scene.height=900;scene.layers=[makeImage(c,&#039;\u95ea\u5f97\u539f\u521b\u7ec3\u4e60\u56fe&#039;)];selected=scene.layers[0].id;hasLoadedExample=true;setDirty(false);zoomLevel=null;selection=null;renderLayers();syncInspector();draw();setProjectStatus(&#039;\u539f\u521b\u793a\u4f8b \u00b7 \u53ef\u653e\u5fc3\u8bd5\u7528&#039;);\r\n}\r\nfunction compareStart(event){if(busy||!active()||active().type!==&#039;image&#039;)return;event?.preventDefault?.();comparingOriginal=true;$(&#039;compareOriginal&#039;).setAttribute(&#039;aria-pressed&#039;,&#039;true&#039;);$(&#039;stageWrap&#039;).classList.add(&#039;comparing&#039;);draw();}\r\nfunction compareEnd(){if(!comparingOriginal)return;comparingOriginal=false;$(&#039;compareOriginal&#039;).setAttribute(&#039;aria-pressed&#039;,&#039;false&#039;);$(&#039;stageWrap&#039;).classList.remove(&#039;comparing&#039;);draw();}\r\nfunction draftStatus(text){$(&#039;autoDraftStatus&#039;).textContent=text;}\r\nfunction draftBanner(record){$(&#039;draftRecovery&#039;).hidden=false;$(&#039;draftRecoveryText&#039;).textContent=&#039;\u53d1\u73b0\u672c\u673a\u8349\u7a3f&#039;+(record.name?&#039;\u201c&#039;+record.name+&#039;\u201d&#039;:&#039;&#039;)+&#039;\uff08&#039;+new Date(record.updatedAt).toLocaleString()+&#039;\uff09\u3002\u6062\u590d\u6216\u660e\u786e\u66ff\u6362\u524d\uff0c\u81ea\u52a8\u4fdd\u5b58\u5df2\u6682\u505c\uff0c\u65e7\u8349\u7a3f\u4e0d\u4f1a\u88ab\u8986\u76d6\u3002&#039;;setProjectStatus(&#039;\u6709\u672c\u673a\u8349\u7a3f\u5f85\u5904\u7406&#039;);}\r\nfunction probeLocalDraftWhenReady(){if(hostBridgeReady&amp;&amp;!draftChecked&amp;&amp;!autoDraftPaused&amp;&amp;(creativeBoot.capabilities.localDraft||creativeBoot.canRetrieve))setTimeout(()=&gt;inspectLocalDraft().catch(()=&gt;{}),0);}\r\nasync function inspectLocalDraft(force=false){\r\n  if(!hostBridgeReady)return;\r\n  if(draftInspectPromise)return draftInspectPromise;if(draftChecked&amp;&amp;!force)return;\r\n  if(!creativeBoot.capabilities.localDraft&amp;&amp;!creativeBoot.canRetrieve)return;\r\n  const scope=creativeBoot.fontScope;\r\n  draftInspectPromise=(async()=&gt;{const record=await requestHostOperation(&#039;draft-peek&#039;,{});if(scope!==creativeBoot.fontScope)return;draftChecked=true;draftCheckedScope=scope;draftToken=record.token||null;draftPending=record.exists===true;autoDraftPaused=false;\r\n    if(draftPending){draftBanner(record);draftStatus(&#039;\u65e7\u8349\u7a3f\u5df2\u4fdd\u7559\uff0c\u81ea\u52a8\u4fdd\u5b58\u6682\u505c\u3002&#039;);}\r\n    else{$(&#039;draftRecovery&#039;).hidden=true;draftStatus(&#039;\u7f16\u8f91\u540e4\u79d2\u81ea\u52a8\u4fdd\u5b58\u5230\u5f53\u524d\u6d4f\u89c8\u5668\u3002&#039;);if(dirty)scheduleAutoDraft();}\r\n  })();try{await draftInspectPromise;}catch(error){if(error.code===&#039;bridge_reconnected&#039;){draftStatus(&#039;\u6b63\u5728\u91cd\u65b0\u8fde\u63a5\u672c\u673a\u8349\u7a3f\u2026&#039;);return;}autoDraftPaused=true;draftStatus(&#039;\u81ea\u52a8\u4fdd\u5b58\u6682\u505c\uff1a&#039;+error.message+&#039; \u53ef\u4f7f\u7528\u4fdd\u5b58\u9879\u76ee\u6587\u4ef6\u3002&#039;);throw error;}finally{draftInspectPromise=null;}\r\n}\r\nfunction scheduleAutoDraft(){clearTimeout(autoDraftTimer);if(!draftChecked||draftPending||autoDraftPaused||!creativeBoot.capabilities.localDraft)return;autoDraftTimer=setTimeout(()=&gt;saveLocalDraft(true),4000);}\r\nfunction confirmDraftOverwrite(){const dialog=$(&#039;replaceDraftDialog&#039;);return new Promise(resolve=&gt;{dialog.returnValue=&#039;cancel&#039;;const close=()=&gt;{dialog.removeEventListener(&#039;close&#039;,close);resolve(dialog.returnValue===&#039;replace&#039;);};dialog.addEventListener(&#039;close&#039;,close);dialog.showModal();});}\r\nasync function saveLocalDraft(automatic=false){\r\n  \/\/ Event listeners pass MouseEvent; only literal true means an automatic write.\r\n  automatic=automatic===true;\r\n  if(automatic&amp;&amp;(autoDraftPaused||draftPending||!draftChecked||!dirty||!creativeBoot.capabilities.localDraft))return;\r\n  if(draftWriting)return;if(busy){if(automatic)scheduleAutoDraft();return;}\r\n  if(!scene.layers.length&amp;&amp;!scene.canvasFixed&amp;&amp;!cutQueue.length){if(!automatic)show(&#039;\u8bf7\u5148\u521b\u5efa\u4f5c\u54c1\uff0c\u518d\u4fdd\u5b58\u8349\u7a3f\u3002&#039;);return;}\r\n  draftWriting=true;\r\n  try{\r\n    if(!automatic&amp;&amp;!await requireAccess(&#039;localDraft&#039;))return;\r\n    if(!draftChecked||(!automatic&amp;&amp;autoDraftPaused))await inspectLocalDraft(true);\r\n    if(!draftChecked)throw Error(&#039;\u8d26\u6237\u8349\u7a3f\u72b6\u6001\u672a\u786e\u8ba4\uff0c\u8bf7\u91cd\u65b0\u6253\u5f00\u5de5\u4f5c\u53f0\u3002&#039;);\r\n    if(draftPending){if(automatic||!await confirmDraftOverwrite())return;draftPending=false;$(&#039;draftRecovery&#039;).hidden=true;}\r\n    const revision=editRevision,scope=creativeBoot.fontScope,text=serializeProject();\r\n    if(new Blob([text]).size&gt;50000000)throw Error(&#039;\u672c\u673a\u8349\u7a3f\u6700\u591a50MB\uff1b\u5927\u9879\u76ee\u8bf7\u4f7f\u7528\u201c\u4fdd\u5b58\u9879\u76ee\u201d\u4e0b\u8f7d\u6587\u4ef6\u3002&#039;);\r\n    draftStatus(&#039;\u6b63\u5728\u4fdd\u5b58\u672c\u673a\u8349\u7a3f\u2026&#039;);const result=await requestHostOperation(&#039;draft-save&#039;,{text,expectedToken:draftToken});\r\n    if(scope!==creativeBoot.fontScope)throw Error(&#039;\u8d26\u6237\u5df2\u53d8\u5316\uff0c\u8bf7\u91cd\u65b0\u6253\u5f00\u5de5\u4f5c\u53f0\u540e\u4fdd\u5b58\u3002&#039;);\r\n    draftToken=result.token;autoDraftPaused=false;if(editRevision===revision)setDirty(false);setProjectStatus(dirty?&#039;\u6709\u672a\u4fdd\u5b58\u7684\u66f4\u6539&#039;:&#039;\u672c\u673a\u8349\u7a3f\u5df2\u4fdd\u5b58&#039;);draftStatus((automatic?&#039;\u5df2\u81ea\u52a8\u4fdd\u5b58&#039;:&#039;\u5df2\u4fdd\u5b58&#039;)+&#039; \u00b7 &#039;+new Date(result.updatedAt).toLocaleTimeString()+&#039;\u3002\u6e05\u7406\u6d4f\u89c8\u5668\u6570\u636e\u4f1a\u5220\u9664\u8349\u7a3f\uff0c\u8bf7\u53e6\u5b58\u91cd\u8981\u9879\u76ee\u3002&#039;);\r\n    if(!automatic)show(&#039;\u672c\u673a\u8349\u7a3f\u5df2\u4fdd\u5b58\uff0c\u5e76\u5df2\u5f00\u542f\u81ea\u52a8\u4fdd\u5b58\u3002\u91cd\u8981\u4f5c\u54c1\u8bf7\u53e6\u5916\u4fdd\u5b58\u9879\u76ee\u6587\u4ef6\u3002&#039;);\r\n    if(dirty)scheduleAutoDraft();\r\n  }catch(error){autoDraftPaused=true;setProjectStatus(&#039;\u81ea\u52a8\u4fdd\u5b58\u6682\u505c\uff0c\u8bf7\u4fdd\u5b58\u9879\u76ee\u6587\u4ef6&#039;);draftStatus(&#039;\u81ea\u52a8\u4fdd\u5b58\u6682\u505c\uff1a&#039;+(error.message||String(error))+&#039; \u53ef\u4e0b\u8f7d\u9879\u76ee\u6587\u4ef6\u5907\u4efd\u3002&#039;);if(!automatic)show(error.message||String(error),true);}\r\n  finally{draftWriting=false;}\r\n}\r\nasync function openLocalDraft(){try{if(typeof requestHostOperation!==&#039;function&#039;)throw Error(&#039;\u8bf7\u4ece\u95ea\u5f97\u7d20\u6750\u7ad9\u6253\u5f00\u4ee5\u6062\u590d\u8349\u7a3f\u3002&#039;);const result=await requestHostOperation(&#039;draft-open&#039;,{});if(typeof result.text!==&#039;string&#039;||new Blob([result.text]).size&gt;50000000)throw Error(&#039;\u8349\u7a3f\u5185\u5bb9\u65e0\u6548\u3002&#039;);if(!await loadProject(new File([result.text],&#039;\u672c\u673a\u8349\u7a3f.json&#039;,{type:&#039;application\/json&#039;}),true))return;draftToken=result.token||null;draftPending=false;draftChecked=true;draftCheckedScope=creativeBoot.fontScope;autoDraftPaused=false;$(&#039;draftRecovery&#039;).hidden=true;hasLoadedExample=false;setProjectStatus(&#039;\u5df2\u6062\u590d\u672c\u673a\u8349\u7a3f&#039;);draftStatus(&#039;\u5df2\u6062\u590d\u672c\u673a\u8349\u7a3f\uff0c\u540e\u7eed\u7f16\u8f91\u5c06\u81ea\u52a8\u4fdd\u5b58\u3002&#039;);}catch(error){show(error.message||String(error),true);}}\r\nfunction initUpgrade(){\r\n  on(&#039;tryDemo&#039;,loadExample);on(&#039;membershipAction&#039;,()=&gt;{if(typeof requestHostOperation===&#039;function&#039;)requestHostOperation(&#039;membership&#039;,{}).catch(error=&gt;show(error.message,true));else show(&#039;\u8bf7\u4ece\u95ea\u5f97\u7d20\u6750\u7ad9\u514d\u8d39\u6ce8\u518c\u6216\u767b\u5f55\u3002&#039;);});\r\n  on(&#039;siteAssets&#039;,()=&gt;{setMode(&#039;assets&#039;);openProperties();});\r\n  on(&#039;saveDraft&#039;,()=&gt;saveLocalDraft(false));on(&#039;openDraft&#039;,openLocalDraft);on(&#039;draftRestore&#039;,openLocalDraft);on(&#039;draftReplace&#039;,()=&gt;saveLocalDraft(false));\r\n  on(&#039;draftKeep&#039;,()=&gt;{$(&#039;draftRecovery&#039;).hidden=true;draftStatus(&#039;\u5df2\u4fdd\u7559\u65e7\u8349\u7a3f\u3002\u5f53\u524d\u4f5c\u54c1\u4e0d\u4f1a\u81ea\u52a8\u4fdd\u5b58\uff0c\u53ef\u4e0b\u8f7d\u9879\u76ee\u6587\u4ef6\uff0c\u6216\u624b\u52a8\u4fdd\u5b58\u8349\u7a3f\u5e76\u660e\u786e\u66ff\u6362\u3002&#039;);});\r\n  on(&#039;replaceDraftCancel&#039;,()=&gt;$(&#039;replaceDraftDialog&#039;).close(&#039;cancel&#039;));on(&#039;replaceDraftConfirm&#039;,()=&gt;$(&#039;replaceDraftDialog&#039;).close(&#039;replace&#039;));\r\n  $(&#039;projectName&#039;).addEventListener(&#039;change&#039;,()=&gt;{setProjectName($(&#039;projectName&#039;).value);markChanged();});\r\n  on(&#039;refreshExportPreview&#039;,refreshExportPreview);[&#039;exportQuality&#039;,&#039;exportWidth&#039;,&#039;exportHeight&#039;,&#039;exportHD&#039;,&#039;exportCompression&#039;,&#039;exportTargetKB&#039;].forEach(id=&gt;$(id).addEventListener(&#039;input&#039;,syncExportInfo));\r\n  $(&#039;exportDialog&#039;).addEventListener(&#039;close&#039;,()=&gt;{clearTimeout(exportPreviewTimer);exportPreviewSerial++;exportCached=null;if(exportPreviewURL)URL.revokeObjectURL(exportPreviewURL);exportPreviewURL=null;$(&#039;exportPreview&#039;).removeAttribute(&#039;src&#039;);$(&#039;exportPreview&#039;).hidden=true;});\r\n  document.addEventListener(&#039;visibilitychange&#039;,()=&gt;{if(document.visibilityState===&#039;hidden&#039;&amp;&amp;dirty)saveLocalDraft(true);});$(&#039;exportHD&#039;).addEventListener(&#039;change&#039;,()=&gt;{exportPreferencesTouched=true;});\r\n  const b=$(&#039;compareOriginal&#039;);b.addEventListener(&#039;pointerdown&#039;,compareStart);[&#039;pointerup&#039;,&#039;pointercancel&#039;,&#039;pointerleave&#039;,&#039;blur&#039;].forEach(name=&gt;b.addEventListener(name,compareEnd));\r\n  b.addEventListener(&#039;keydown&#039;,e=&gt;{if(e.key===&#039; &#039;||e.key===&#039;Enter&#039;)compareStart(e);});b.addEventListener(&#039;keyup&#039;,compareEnd);window.addEventListener(&#039;blur&#039;,compareEnd);\r\n  window.addEventListener(&#039;resize&#039;,()=&gt;{if(zoomLevel===null)draw();});\r\n  document.addEventListener(&#039;keydown&#039;,e=&gt;{if((e.ctrlKey||e.metaKey)&amp;&amp;e.key.toLowerCase()===&#039;s&#039;){e.preventDefault();saveLocalDraft();}});\r\n}\r\n\r\n\/\/ Inserted inside the existing workspace closure; no global state or source URLs.\r\nconst expectedHostOrigin=new URL((window.SHANDE_IMAGE_WORKSPACE||{}).hostUrl||&#039;https:\/\/www.zipget.cn\/&#039;).origin;\r\nlet hostBridgeReady=false;\r\nlet hostBridgeGeneration=0,hostDownloadSerial=0;\r\n\/\/ BEGIN SHANDE_FOCUS_CLIENT_V3\r\nlet workspaceFocused=false,focusRequestPending=false;\r\nfunction applyWorkspaceFocus(enabled){\r\n  const next=enabled===true;if(workspaceFocused===next)return;\r\n  workspaceFocused=next;document.documentElement.classList.toggle(&#039;siw-focus&#039;,next);\r\n  const button=$(&#039;focusWorkspace&#039;);button.setAttribute(&#039;aria-pressed&#039;,String(next));button.setAttribute(&#039;aria-label&#039;,next?&#039;\u9000\u51fa\u4e13\u6ce8\u6a21\u5f0f&#039;:&#039;\u8fdb\u5165\u4e13\u6ce8\u6a21\u5f0f&#039;);button.title=next?&#039;\u9000\u51fa\u4e13\u6ce8\u6a21\u5f0f\uff08Esc\uff09&#039;:&#039;\u653e\u5927\u5de5\u4f5c\u53f0\uff0c\u4e13\u6ce8\u521b\u4f5c&#039;;$(&#039;focusLabel&#039;).textContent=next?&#039;\u9000\u51fa\u4e13\u6ce8&#039;:&#039;\u4e13\u6ce8&#039;;\r\n  requestAnimationFrame(()=&gt;window.dispatchEvent(new Event(&#039;resize&#039;)));\r\n}\r\nasync function toggleWorkspaceFocus(force){\r\n  if(focusRequestPending)return;const enabled=typeof force===&#039;boolean&#039;?force:!workspaceFocused;\r\n  if(window.parent===window){applyWorkspaceFocus(enabled);return;}\r\n  if(!hostBridgeReady){show(&#039;\u5de5\u4f5c\u53f0\u6b63\u5728\u8fde\u63a5\uff0c\u8bf7\u7a0d\u540e\u518d\u8fdb\u5165\u4e13\u6ce8\u6a21\u5f0f\u3002&#039;);return;}\r\n  focusRequestPending=true;$(&#039;focusWorkspace&#039;).disabled=true;\r\n  try{const result=await requestHostOperation(&#039;workspace-focus&#039;,{enabled});applyWorkspaceFocus(result.enabled===true);}\r\n  catch(error){show(error.message||&#039;\u6682\u65f6\u65e0\u6cd5\u5207\u6362\u4e13\u6ce8\u6a21\u5f0f\uff0c\u5f53\u524d\u7f16\u8f91\u4ecd\u4fdd\u7559\u3002&#039;,true);}\r\n  finally{focusRequestPending=false;$(&#039;focusWorkspace&#039;).disabled=false;}\r\n}\r\n$(&#039;focusWorkspace&#039;).addEventListener(&#039;click&#039;,()=&gt;toggleWorkspaceFocus());\r\ndocument.addEventListener(&#039;keydown&#039;,event=&gt;{if(event.key===&#039;Escape&#039;&amp;&amp;!event.defaultPrevented&amp;&amp;workspaceFocused&amp;&amp;!document.querySelector(&#039;dialog[open]&#039;)&amp;&amp;!$(&#039;propertiesDrawer&#039;).classList.contains(&#039;open&#039;)){event.preventDefault();toggleWorkspaceFocus(false);}});\r\n\/\/ END SHANDE_FOCUS_CLIENT_V3\r\n\/\/ SHANDE_MOBILE_SELECTION_DOCK_V3: move native controls, never clone editing inputs.\r\nconst selectionMobileDock=document.createElement(&#039;div&#039;);selectionMobileDock.className=&#039;selection-mobile-dock&#039;;selectionMobileDock.hidden=true;\r\n$(&#039;selectionPanel&#039;).insertBefore(selectionMobileDock,$(&#039;selectionRefine&#039;));\r\nconst selectionMobileSlots=[document.querySelector(&#039;.selection-tools .padding-control&#039;),$(&#039;downloadSelection&#039;),$(&#039;clearSelection&#039;),document.querySelector(&#039;.selection-advanced&#039;),$(&#039;mobilePropertiesToggle&#039;)].map(node=&gt;{const marker=document.createComment(&#039;mobile selection control home&#039;);node.parentNode.insertBefore(marker,node);return {node,marker};});\r\nlet compactSelectionLayout=false;\r\nfunction syncCompactSelectionLayout(){\r\n  const enabled=workspaceFocused&amp;&amp;window.matchMedia(&#039;(max-width:600px) and (max-height:600px)&#039;).matches;if(enabled===compactSelectionLayout)return;\r\n  compactSelectionLayout=enabled;$(&#039;app&#039;).classList.toggle(&#039;compact-selection&#039;,enabled);selectionMobileDock.hidden=!enabled;\r\n  for(const slot of selectionMobileSlots){if(enabled){(slot.node.id===&#039;mobilePropertiesToggle&#039;?document.querySelector(&#039;.selection-tools&#039;):selectionMobileDock).append(slot.node);}else slot.marker.parentNode.insertBefore(slot.node,slot.marker.nextSibling);}\r\n  requestAnimationFrame(()=&gt;window.dispatchEvent(new Event(&#039;resize&#039;)));\r\n}\r\ndocument.querySelectorAll(&#039;.selection-tools .segmented button[data-tool]&#039;).forEach(button=&gt;{const label={lasso:&#039;\u5957\u7d22\u9009\u533a&#039;,ellipse:&#039;\u692d\u5706\u9009\u533a&#039;,rect:&#039;\u77e9\u5f62\u9009\u533a&#039;}[button.dataset.tool];if(label){button.setAttribute(&#039;aria-label&#039;,label);button.title=label;}});\r\nwindow.addEventListener(&#039;resize&#039;,syncCompactSelectionLayout);\r\n\/\/ END SHANDE_MOBILE_SELECTION_DOCK_V3\r\n\r\n\r\nconst handledHostRequests=new Set(),confirmedDownloads=new Map();\r\nfunction postHost(message){if(window.parent!==window)window.parent.postMessage({...message,protocol:1,generation:hostBridgeGeneration},expectedHostOrigin);}\r\nfunction reportHostBusy(){postHost({type:&#039;sd:image-workspace-host-busy&#039;,busy:!!busy});}\r\nfunction reportHostDirty(){postHost({type:&#039;sd:image-workspace-host-dirty&#039;,dirty:!!dirty});}\r\nfunction hostDownloadConfirmed(blob,name){if(window.parent===window){download(blob,name);return Promise.resolve();}if(!hostBridgeReady)return Promise.reject(Error(&#039;\u7ad9\u70b9\u8fde\u63a5\u5c1a\u672a\u5c31\u7eea\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5\uff1b\u5f53\u524d\u7f16\u8f91\u4ecd\u4fdd\u7559\u3002&#039;));if(!(blob instanceof Blob)||!blob.size||blob.size&gt;100000000)return Promise.reject(Error(&#039;\u9879\u76ee\u6587\u4ef6\u65e0\u6548\u6216\u8d85\u8fc7100MB\u3002&#039;));return new Promise((resolve,reject)=&gt;{const requestId=++hostDownloadSerial,timer=setTimeout(()=&gt;{confirmedDownloads.delete(requestId);reject(Error(&#039;\u9879\u76ee\u4e0b\u8f7d\u672a\u83b7\u786e\u8ba4\uff0c\u5f53\u524d\u7f16\u8f91\u4ecd\u4fdd\u7559\uff0c\u8bf7\u91cd\u8bd5\u4fdd\u5b58\u3002&#039;));},25000);confirmedDownloads.set(requestId,{resolve,reject,timer});postHost({type:&#039;sd:image-workspace-host-download&#039;,requestId,blob,name:String(name||&#039;\u56fe\u7247\u9879\u76ee&#039;)});});}\r\nfunction hostDownload(blob,name){\r\n  if(window.parent===window||!hostBridgeReady)return false;\r\n  if(!(blob instanceof Blob)||blob.size&gt;100000000)throw Error(&#039;\u4e0b\u8f7d\u6587\u4ef6\u8d85\u8fc7100MB\uff0c\u8bf7\u51cf\u5c11\u56fe\u7247\u6570\u91cf\u6216\u5c3a\u5bf8\u3002&#039;);\r\n  postHost({type:&#039;sd:image-workspace-host-download&#039;,requestId:++hostDownloadSerial,blob,name:String(name||&#039;\u56fe\u7247&#039;)});\r\n  const box=$(&#039;downloads&#039;);box.hidden=false;box.replaceChildren();const info=document.createElement(&#039;p&#039;);info.textContent=&#039;\u6587\u4ef6\u5df2\u4ea4\u7ed9\u9875\u9762\u4e0b\u65b9\u7684\u8bb0\u5f55\u533a\u3002\u5982\u672a\u81ea\u52a8\u4e0b\u8f7d\uff0c\u8bf7\u70b9\u51fb\u4e0b\u65b9\u201c\u518d\u6b21\u4e0b\u8f7d\u201d\u94fe\u63a5\u3002&#039;;box.append(info);\r\n  return true;\r\n}\r\nasync function requestLocalPicker(kind){\r\n  if(!await requireAccess(&#039;import&#039;))return;\r\n  if(window.parent!==window&amp;&amp;hostBridgeReady){\r\n    postHost({type:&#039;sd:image-workspace-host-select&#039;,kind});\r\n    show(&#039;\u5982\u679c\u9009\u62e9\u7a97\u53e3\u6ca1\u6709\u6253\u5f00\uff0c\u8bf7\u5c55\u5f00\u5de5\u4f5c\u53f0\u4e0b\u65b9\u7684\u201c\u672c\u673a\u6587\u4ef6\u4e0e\u4e0b\u8f7d\u8bb0\u5f55\u201d\uff0c\u518d\u70b9\u51fb\u201c&#039;+(kind===&#039;images&#039;?&#039;\u672c\u673a\u6dfb\u52a0\u56fe\u7247&#039;:&#039;\u6253\u5f00\u672c\u673a\u9879\u76ee&#039;)+&#039;\u201d\u3002&#039;);\r\n  }else $(kind===&#039;images&#039;?&#039;fileInput&#039;:&#039;projectInput&#039;).click();\r\n}\r\nwindow.addEventListener(&#039;message&#039;,async event=&gt;{\r\n  if(event.source!==window.parent||window.parent===window||event.origin!==expectedHostOrigin)return;\r\n  const message=event.data;\r\n  if(!message||message.protocol!==1||typeof message.type!==&#039;string&#039;)return;\r\n  if(message.type===&#039;sd:image-workspace-host-ping&#039;){\r\n    if(!Number.isSafeInteger(message.generation)||message.generation&lt;0)return;\r\n    if(message.generation!==hostBridgeGeneration){\r\n      hostBridgeReady=false;\r\n      \/\/ Only the read-only startup probe may be retried across a handshake generation.\r\n      for(const [requestId,pending] of creativeRequests){if(pending.operation===&#039;draft-peek&#039;){creativeRequests.delete(requestId);clearTimeout(pending.timer);const error=Error(&#039;\u5de5\u4f5c\u53f0\u8fde\u63a5\u5df2\u66f4\u65b0\u3002&#039;);error.code=&#039;bridge_reconnected&#039;;pending.reject(error);}}\r\n    }\r\n    hostBridgeGeneration=message.generation;\r\n    postHost({type:&#039;sd:image-workspace-host-ready&#039;,busy:!!busy});return;\r\n  }\r\n  if(message.generation!==hostBridgeGeneration)return;\r\n  if(message.type===&#039;sd:image-workspace-host-focus&#039;){if(typeof message.enabled===&#039;boolean&#039;)applyWorkspaceFocus(message.enabled);return;}\r\n  if(message.type===&#039;sd:image-workspace-host-viewport&#039;){\r\n    const top=Number(message.top),bottom=Number(message.bottom),height=Number(message.height);\r\n    if(![top,bottom,height].every(Number.isFinite)||height&lt;1||height&gt;6000||top&lt;0||bottom&lt;top||bottom&gt;height)return;\r\n    const style=document.documentElement.style;\r\n    style.setProperty(&#039;--sd-visible-top&#039;,Math.round(top)+&#039;px&#039;);\r\n    style.setProperty(&#039;--sd-visible-bottom-offset&#039;,Math.round(height-bottom)+&#039;px&#039;);\r\n    style.setProperty(&#039;--sd-visible-height&#039;,Math.round(bottom-top)+&#039;px&#039;);\r\n    if(typeof message.focus===&#039;boolean&#039;)applyWorkspaceFocus(message.focus);\r\n    return;\r\n  }\r\n  if(message.type===&#039;sd:image-workspace-host-ack&#039;){\r\n    hostBridgeReady=true;reportHostBusy();reportHostDirty();probeLocalDraftWhenReady();return;\r\n  }\r\n  if(message.type===&#039;sd:image-workspace-host-download-result&#039;){const item=confirmedDownloads.get(message.requestId);if(!item)return;confirmedDownloads.delete(message.requestId);clearTimeout(item.timer);if(message.ok)item.resolve();else item.reject(Error(message.message||&#039;\u9879\u76ee\u4e0b\u8f7d\u5931\u8d25\uff0c\u5f53\u524d\u7f16\u8f91\u4ecd\u4fdd\u7559\u3002&#039;));return;}\r\n  if(message.type!==&#039;sd:image-workspace-host-files&#039;)return;\r\n  const requestId=message.requestId;\r\n  if(!Number.isSafeInteger(requestId)||requestId&lt;1)return;\r\n  const acknowledge=status=&gt;postHost({type:&#039;sd:image-workspace-host-received&#039;,requestId,status});\r\n  if(handledHostRequests.has(requestId)){acknowledge(&#039;duplicate&#039;);return;}\r\n  if(busy){acknowledge(&#039;busy&#039;);return;}\r\n  const kind=message.kind,files=message.files;\r\n  if(![&#039;images&#039;,&#039;project&#039;].includes(kind)||!Array.isArray(files)||!files.length||files.length&gt;(kind===&#039;images&#039;?20:1)||!files.every(file=&gt;file instanceof File&amp;&amp;Number.isFinite(file.size)&amp;&amp;file.size&lt;=(kind===&#039;images&#039;?40000000:100000000))){\r\n    show(&#039;\u6536\u5230\u7684\u672c\u673a\u6587\u4ef6\u65e0\u6548\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002&#039;,true);acknowledge(&#039;rejected&#039;);return;\r\n  }\r\n  handledHostRequests.add(requestId);\r\n  while(handledHostRequests.size&gt;40)handledHostRequests.delete(handledHostRequests.values().next().value);\r\n  try{\r\n    if(kind===&#039;images&#039;)await importFiles(files);else await loadProject(files[0]);\r\n    \/\/ The original import functions show validation results inside the workspace.\r\n    \/\/ This acknowledges delivery\/handling, never claims parsing or editing succeeded.\r\n    acknowledge(&#039;handled&#039;);\r\n  }catch(error){show(error.message||String(error),true);acknowledge(&#039;rejected&#039;);}\r\n});\r\npostHost({type:&#039;sd:image-workspace-host-ready&#039;,busy:!!busy});\r\n\r\n\/\/ The sandbox cannot mint membership: every protected action asks its exact host.\r\nlet creativeRequestSerial=0;\r\nconst creativeRequests=new Map();\r\nfunction requestHostOperation(operation,payload={}){\r\n  if(window.parent===window)return Promise.reject(Error(&#039;\u8bf7\u4ece\u95ea\u5f97\u7d20\u6750\u7ad9\u6253\u5f00\u56fe\u7247\u5de5\u4f5c\u53f0\u3002&#039;));\r\n  return new Promise((resolve,reject)=&gt;{\r\n    const requestId=++creativeRequestSerial;\r\n    const timer=setTimeout(()=&gt;{creativeRequests.delete(requestId);reject(Error(&#039;\u7ad9\u70b9\u8fde\u63a5\u8d85\u65f6\uff0c\u8bf7\u5237\u65b0\u9875\u9762\u540e\u91cd\u8bd5\uff0c\u5f53\u524d\u7f16\u8f91\u4ecd\u4fdd\u7559\u3002&#039;));},[&#039;font-fetch&#039;,&#039;catalog-use&#039;].includes(operation)?120000:25000);\r\n    creativeRequests.set(requestId,{resolve,reject,timer,operation});\r\n    postHost({type:&#039;sd:image-workspace-creative-request&#039;,operation,requestId,...payload});\r\n  });\r\n}\r\nwindow.addEventListener(&#039;message&#039;,event=&gt;{\r\n  if(event.source!==window.parent||window.parent===window||event.origin!==expectedHostOrigin)return;\r\n  const data=event.data;if(!data||data.protocol!==1||data.generation!==hostBridgeGeneration)return;\r\n  if(data.type===&#039;sd:image-workspace-creative-boot&#039;){receiveCreativeBoot(data.boot);return;}\r\n  if(data.type!==&#039;sd:image-workspace-creative-result&#039;||!Number.isSafeInteger(data.requestId))return;\r\n  const pending=creativeRequests.get(data.requestId);if(!pending)return;creativeRequests.delete(data.requestId);clearTimeout(pending.timer);\r\n  if(data.ok)pending.resolve(data.result||{});else pending.reject(Error(data.message||&#039;\u64cd\u4f5c\u672a\u5b8c\u6210\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\u3002&#039;));\r\n});\r\n\r\nfunction resizeImagePixels(){try{const l=imageLayer();if(l.locked)throw Error(&#039;\u8be5\u56fe\u5c42\u5df2\u9501\u5b9a\uff0c\u8bf7\u5148\u89e3\u9501\u3002&#039;);if(adjusted)throw Error(&#039;\u8bf7\u5148\u5e94\u7528\u6216\u91cd\u7f6e\u8c03\u8272\u3002&#039;);const size=guardSize($(&#039;pixelW&#039;).value,$(&#039;pixelH&#039;).value);if(pixelCount()-l.image.width*l.image.height+size.w*size.h&gt;MAX_ASSET_PIXELS)throw Error(&#039;\u8c03\u6574\u540e\u56fe\u7247\u603b\u50cf\u7d20\u8d85\u8fc73200\u4e07\uff0c\u8bf7\u51cf\u5c0f\u5c3a\u5bf8\u3002&#039;);const next=C.resize(l.image,size.w,size.h),fitScene=!scene.canvasFixed&amp;&amp;scene.layers.length===1;pushHistory();l.image=next;l.canvas=next;l.baseline=cloneCanvas(next);if(fitScene){l.x=l.y=0;l.width=size.w;l.height=size.h;scene.width=size.w;scene.height=size.h;}selection=null;renderLayers();syncInspector();draw();show(&#039;\u56fe\u7247\u5df2\u8c03\u6574\u4e3a &#039;+size.w+&#039; \u00d7 &#039;+size.h+&#039; px\uff0c\u53ef\u64a4\u9500\u3002&#039;+(fitScene?&#039;&#039;:&#039;\u6d77\u62a5\u4e2d\u7684\u6392\u7248\u5c3a\u5bf8\u4fdd\u6301\u4e0d\u53d8\u3002&#039;));}catch(error){show(error.message,true);}}\r\nfunction addShape(kind){if(scene.layers.length&gt;=50){show(&#039;\u9879\u76ee\u6700\u591a50\u4e2a\u56fe\u5c42\u3002&#039;,true);return;}const names={rect:&#039;\u77e9\u5f62&#039;,roundrect:&#039;\u5706\u89d2\u77e9\u5f62&#039;,ellipse:&#039;\u692d\u5706&#039;,triangle:&#039;\u4e09\u89d2\u5f62&#039;,line:&#039;\u76f4\u7ebf&#039;,arrow:&#039;\u7bad\u5934&#039;};if(!names[kind])return;pushHistory();const w=Math.max(40,Math.round(scene.width*.35)),h=[&#039;line&#039;,&#039;arrow&#039;].includes(kind)?Math.max(20,Math.round(scene.height*.08)):Math.max(40,Math.round(scene.height*.25));const l={id:nextId++,type:&#039;shape&#039;,shape:kind,name:names[kind],x:(scene.width-w)\/2,y:(scene.height-h)\/2,width:w,height:h,color:&#039;#2468eb&#039;,noFill:false,rotation:0,opacity:1,visible:true,strokeWidth:[&#039;line&#039;,&#039;arrow&#039;].includes(kind)?Math.max(3,Math.round(scene.width*.004)):0,strokeColor:&#039;#2468eb&#039;,shadowBlur:0,shadowColor:&#039;#000000&#039;,shadowOffsetX:0,shadowOffsetY:0};scene.layers.push(l);selected=l.id;selection=null;setMode(&#039;shape&#039;);renderLayers();syncInspector();draw();}\r\nfunction openExport(target=&#039;scene&#039;){if(!scene.layers.length&amp;&amp;!scene.canvasFixed){show(&#039;\u8bf7\u5148\u6253\u5f00\u56fe\u7247\u6216\u65b0\u5efa\u8bbe\u8ba1\u3002&#039;,true);return;}requireAccess(&#039;basicExport&#039;).then(allowed=&gt;{if(allowed){$(&#039;exportTarget&#039;).value=target;$(&#039;exportName&#039;).value=projectName;$(&#039;exportDialog&#039;).showModal();syncExportInfo();}});}\r\nfunction syncExportInfo(){const l=active(),single=$(&#039;exportTarget&#039;).value===&#039;layer&#039;,w=single?(l?.type===&#039;image&#039;?l.image.width:Math.ceil(l?.width||0)):scene.width,h=single?(l?.type===&#039;image&#039;?l.image.height:Math.ceil(l?.height||0)):scene.height;$(&#039;exportSourceInfo&#039;).textContent=single?(l?&#039;\u9009\u4e2d\uff1a&#039;+l.name+&#039; \u00b7 &#039;+w+&#039; \u00d7 &#039;+h+&#039; px\uff1b\u56fe\u7247\u6309\u5f53\u524d\u50cf\u7d20\u8f93\u51fa\uff0c\u4e0d\u5305\u542b\u6d77\u62a5\u91cc\u7684\u65cb\u8f6c\u3001\u63cf\u8fb9\u3001\u76f8\u6846\u4e0e\u4f4d\u7f6e\u3002&#039;:&#039;\u8bf7\u5148\u9009\u62e9\u56fe\u5c42\u3002&#039;):&#039;\u6574\u5f20\u753b\u5e03 \u00b7 &#039;+w+&#039; \u00d7 &#039;+h+&#039; px\uff0c\u5305\u542b\u53ef\u89c1\u56fe\u5c42\u4e0e\u80cc\u666f\u3002&#039;;const png=$(&#039;exportFormat&#039;).value===&#039;png&#039;;$(&#039;exportQuality&#039;).disabled=png;$(&#039;exportCompression&#039;).disabled=png;$(&#039;exportTargetKB&#039;).disabled=png||$(&#039;exportCompression&#039;).value!==&#039;target&#039;;$(&#039;exportQualityHint&#039;).textContent=png?&#039;PNG\u4f7f\u7528\u65e0\u635f\u7f16\u7801\uff0c\u4e0d\u4f7f\u7528\u8d28\u91cf\u548c\u76ee\u6807KB\u53c2\u6570\u3002&#039;:&#039;\u8d28\u91cf\u6a21\u5f0f\u4f7f\u7528\u6307\u5b9a\u8d28\u91cf\uff1b\u76ee\u6807KB\u6a21\u5f0f\u4ece\u6700\u9ad8\u8d28\u91cf\u5411\u4e0b\u5c1d\u8bd5\uff0c\u59cb\u7ec8\u4fdd\u6301\u4e0b\u65b9\u663e\u793a\u7684\u8f93\u51fa\u50cf\u7d20\u3002JPG\u900f\u660e\u5904\u586b\u5145\u767d\u8272\u3002&#039;;invalidateExportPreview();}\r\nfunction on(id,fn){$(id).addEventListener(&#039;click&#039;,fn);}\r\non(&#039;replaceProjectCancel&#039;,()=&gt;$(&#039;replaceProjectDialog&#039;).close(&#039;cancel&#039;));on(&#039;replaceProjectConfirm&#039;,()=&gt;$(&#039;replaceProjectDialog&#039;).close(&#039;replace&#039;));\r\non(&#039;importBtn&#039;,()=&gt;requestLocalPicker(&#039;images&#039;));on(&#039;emptyImport&#039;,()=&gt;requestLocalPicker(&#039;images&#039;));$(&#039;fileInput&#039;).addEventListener(&#039;change&#039;,e=&gt;importFiles(e.target.files));on(&#039;undo&#039;,undo);on(&#039;redo&#039;,redo);on(&#039;fit&#039;,()=&gt;{zoomLevel=null;draw();});async function clearCanvas(){if(busy||!await confirmProjectReplacement())return;try{const size=guardSize($(&#039;newCanvasW&#039;).value,$(&#039;newCanvasH&#039;).value);resetDesignScene(size.w,size.h,$(&#039;newTransparent&#039;).checked?null:$(&#039;newCanvasBg&#039;).value,[]);setMode(&#039;canvas&#039;);$(&#039;newCanvasDialog&#039;).close();resetProjectIdentity();show(&#039;\u7a7a\u767d\u8bbe\u8ba1\u5df2\u521b\u5efa\uff0c\u53ef\u6dfb\u52a0\u56fe\u7247\u3001\u6587\u5b57\u6216\u5f62\u72b6\u3002&#039;);}catch(error){show(error.message,true);}}on(&#039;newCanvas&#039;,()=&gt;$(&#039;newCanvasDialog&#039;).showModal());on(&#039;emptyNew&#039;,()=&gt;$(&#039;newCanvasDialog&#039;).showModal());on(&#039;confirmNewCanvas&#039;,clearCanvas);$(&#039;newPreset&#039;).addEventListener(&#039;change&#039;,()=&gt;{if($(&#039;newPreset&#039;).value===&#039;custom&#039;)return;const [w,h]=$(&#039;newPreset&#039;).value.split(&#039;x&#039;);$(&#039;newCanvasW&#039;).value=w;$(&#039;newCanvasH&#039;).value=h;});[&#039;newCanvasW&#039;,&#039;newCanvasH&#039;].forEach(id=&gt;$(id).addEventListener(&#039;input&#039;,()=&gt;$(&#039;newPreset&#039;).value=&#039;custom&#039;));document.querySelectorAll(&#039;.dialog-close&#039;).forEach(button=&gt;button.addEventListener(&#039;click&#039;,()=&gt;button.closest(&#039;dialog&#039;).close()));on(&#039;addText&#039;,addText);on(&#039;exportOpen&#039;,()=&gt;openExport(&#039;scene&#039;));on(&#039;singleExport&#039;,()=&gt;openExport(&#039;layer&#039;));on(&#039;batchOpen&#039;,()=&gt;$(&#039;batchDialog&#039;).showModal());on(&#039;applyPixelResize&#039;,resizeImagePixels);[&#039;pixelW&#039;,&#039;pixelH&#039;].forEach(id=&gt;$(id).addEventListener(&#039;input&#039;,()=&gt;{const l=active();if(!l||l.type!==&#039;image&#039;||!$(&#039;pixelRatio&#039;).checked)return;const v=Number($(id).value);if(v&gt;0)$(id===&#039;pixelW&#039;?&#039;pixelH&#039;:&#039;pixelW&#039;).value=Math.max(1,Math.round(id===&#039;pixelW&#039;?v*l.image.height\/l.image.width:v*l.image.width\/l.image.height));}));document.querySelectorAll(&#039;[data-shape]&#039;).forEach(button=&gt;button.addEventListener(&#039;click&#039;,()=&gt;addShape(button.dataset.shape)));[&#039;shapeFill&#039;,&#039;shapeNoFill&#039;].forEach(id=&gt;$(id).addEventListener(&#039;change&#039;,()=&gt;{const l=active();if(!l||l.type!==&#039;shape&#039;)return;pushHistory();l.color=$(&#039;shapeFill&#039;).value;l.noFill=$(&#039;shapeNoFill&#039;).checked;if(l.noFill&amp;&amp;!l.strokeWidth){l.strokeWidth=3;l.strokeColor=l.color;}syncInspector();renderLayers();draw();}));on(&#039;exportScene&#039;,()=&gt;exportOne($(&#039;exportTarget&#039;).value===&#039;layer&#039;));[&#039;exportTarget&#039;,&#039;exportFormat&#039;].forEach(id=&gt;$(id).addEventListener(&#039;change&#039;,syncExportInfo));$(&#039;batchFormat&#039;).addEventListener(&#039;change&#039;,()=&gt;$(&#039;batchQuality&#039;).disabled=$(&#039;batchFormat&#039;).value===&#039;png&#039;);$(&#039;batchQuality&#039;).disabled=true;on(&#039;batchExport&#039;,batchExport);on(&#039;splitExport&#039;,splitExport);on(&#039;collage&#039;,collage);on(&#039;saveProject&#039;,saveProject);on(&#039;loadProject&#039;,()=&gt;requestLocalPicker(&#039;project&#039;));$(&#039;projectInput&#039;).addEventListener(&#039;change&#039;,e=&gt;loadProject(e.target.files[0]));\r\ndocument.querySelectorAll(&#039;[data-tool]&#039;).forEach(btn=&gt;btn.addEventListener(&#039;click&#039;,()=&gt;{if(workspaceMode===&#039;selection&#039;&amp;&amp;![&#039;rect&#039;,&#039;ellipse&#039;,&#039;lasso&#039;].includes(btn.dataset.tool))setMode(&#039;edit&#039;);setTool(btn.dataset.tool);}));document.querySelectorAll(&#039;[data-tab]&#039;).forEach(btn=&gt;btn.addEventListener(&#039;click&#039;,()=&gt;{document.querySelectorAll(&#039;[data-tab]&#039;).forEach(b=&gt;b.classList.toggle(&#039;active&#039;,b===btn));document.querySelectorAll(&#039;.tab-content&#039;).forEach(t=&gt;t.hidden=t.id!==&#039;tab-&#039;+btn.dataset.tab);}));document.querySelectorAll(&#039;[data-size]&#039;).forEach(btn=&gt;btn.addEventListener(&#039;click&#039;,()=&gt;{const [w,h]=btn.dataset.size.split(&#039;x&#039;).map(Number);canvasResize(w,h);}));on(&#039;applyCanvas&#039;,()=&gt;canvasResize($(&#039;canvasW&#039;).value,$(&#039;canvasH&#039;).value));[&#039;transparentBg&#039;,&#039;canvasBg&#039;].forEach(id=&gt;$(id).addEventListener(&#039;change&#039;,()=&gt;{pushHistory();scene.background=$(&#039;transparentBg&#039;).checked?null:$(&#039;canvasBg&#039;).value;draw();}));\r\nconst propertyMap={layerX:&#039;x&#039;,layerY:&#039;y&#039;,layerW:&#039;width&#039;,layerH:&#039;height&#039;,layerRotation:&#039;rotation&#039;,layerOpacity:&#039;opacity&#039;,strokeWidth:&#039;strokeWidth&#039;,strokeColor:&#039;strokeColor&#039;,shadowBlur:&#039;shadowBlur&#039;,shadowColor:&#039;shadowColor&#039;,shadowX:&#039;shadowOffsetX&#039;,shadowY:&#039;shadowOffsetY&#039;};Object.entries(propertyMap).forEach(([id,key])=&gt;$(id).addEventListener(&#039;change&#039;,()=&gt;changeLayer(id,key)));\r\n$(&#039;textValue&#039;).addEventListener(&#039;input&#039;,canvasTextInput);$(&#039;textValue&#039;).addEventListener(&#039;blur&#039;,()=&gt;{textEditSession=null;syncInspector();});\r\n[&#039;textSize&#039;,&#039;textColor&#039;,&#039;textFont&#039;,&#039;textBold&#039;,&#039;textAlign&#039;,&#039;textLineHeight&#039;].forEach(id=&gt;$(id).addEventListener(&#039;change&#039;,()=&gt;canvasTextStyle(id)));\r\non(&#039;centerLayer&#039;,()=&gt;canvasAlignment(&#039;center&#039;));on(&#039;deleteLayer&#039;,canvasDelete);on(&#039;duplicate&#039;,canvasDuplicate);on(&#039;layerUp&#039;,()=&gt;canvasOrder(&#039;up&#039;));on(&#039;layerDown&#039;,()=&gt;canvasOrder(&#039;down&#039;));on(&#039;layerTop&#039;,()=&gt;canvasOrder(&#039;top&#039;));on(&#039;layerBottom&#039;,()=&gt;canvasOrder(&#039;bottom&#039;));\r\non(&#039;groupSelection&#039;,()=&gt;canvasGroup());on(&#039;ungroupSelection&#039;,()=&gt;canvasGroup(true));on(&#039;lockSelection&#039;,canvasToggleLock);document.querySelectorAll(&#039;[data-canvas-align]&#039;).forEach(button=&gt;button.addEventListener(&#039;click&#039;,()=&gt;canvasAlignment(button.dataset.canvasAlign)));\r\n$(&#039;stage&#039;).addEventListener(&#039;dblclick&#039;,event=&gt;{if(tool!==&#039;move&#039;||busy)return;const l=hitLayer(stagePoint(event));if(l?.type===&#039;text&#039;){event.preventDefault();beginCanvasTextEditing(l);}});\r\n$(&#039;stageWrap&#039;).addEventListener(&#039;scroll&#039;,positionCanvasTextEditor);window.addEventListener(&#039;scroll&#039;,positionCanvasTextEditor,true);window.addEventListener(&#039;resize&#039;,positionCanvasTextEditor);\r\n\r\non(&#039;rotateLeft&#039;,()=&gt;modifyPixels(c=&gt;C.transform(c,{rotate:-1}),&#039;\u5df2\u5411\u5de6\u65cb\u8f6c\u3002&#039;));on(&#039;rotateRight&#039;,()=&gt;modifyPixels(c=&gt;C.transform(c,{rotate:1}),&#039;\u5df2\u5411\u53f3\u65cb\u8f6c\u3002&#039;));on(&#039;flipX&#039;,()=&gt;modifyPixels(c=&gt;C.transform(c,{flipX:true}),&#039;\u5df2\u6c34\u5e73\u7ffb\u8f6c\u3002&#039;));on(&#039;flipY&#039;,()=&gt;modifyPixels(c=&gt;C.transform(c,{flipY:true}),&#039;\u5df2\u5782\u76f4\u7ffb\u8f6c\u3002&#039;));on(&#039;trimTransparent&#039;,()=&gt;modifyPixels(c=&gt;C.trimTransparent(c,{padding:1}),&#039;\u5df2\u88c1\u53bb\u900f\u660e\u7559\u767d\u3002&#039;));on(&#039;resetPixels&#039;,()=&gt;modifyPixels((c,l)=&gt;cloneCanvas(l.original),&#039;\u5df2\u6062\u590d\u539f\u59cb\u56fe\u7247\u3002&#039;));on(&#039;clearSelection&#039;,()=&gt;{selection=null;lastSelectionQueued=false;lastQueuedCutId=null;syncInspector();draw();});on(&#039;cropSelection&#039;,()=&gt;applySelection(false));on(&#039;extractSelection&#039;,()=&gt;applySelection(true));on(&#039;mosaicSelection&#039;,()=&gt;{if(!selection){show(&#039;\u8bf7\u5148\u753b\u51fa\u9009\u533a\u3002&#039;,true);return;}const saved=selection;modifyPixels(c=&gt;{C.mosaic(c,{selection:saved,blockSize:Number($(&#039;mosaicSize&#039;).value)});return null;},&#039;\u5df2\u6dfb\u52a0\u9009\u533a\u9a6c\u8d5b\u514b\u3002&#039;);});adjustIds.forEach(id=&gt;$(id).addEventListener(&#039;input&#039;,previewAdjust));$(&#039;grayscale&#039;).addEventListener(&#039;change&#039;,previewAdjust);on(&#039;clearAdjust&#039;,()=&gt;resetAdjust());on(&#039;applyAdjust&#039;,()=&gt;{try{const l=imageLayer();pushHistory();l.image=C.adjust(l.image,adjustValues());l.canvas=l.image;l.baseline=cloneCanvas(l.image);resetAdjust(false);renderLayers();draw();show(&#039;\u8c03\u8272\u5df2\u5e94\u7528\u3002&#039;);}catch(e){show(e.message,true);}});\r\n$(&#039;stage&#039;).addEventListener(&#039;pointerdown&#039;,startPointer);$(&#039;stage&#039;).addEventListener(&#039;pointermove&#039;,movePointer);$(&#039;stage&#039;).addEventListener(&#039;pointerup&#039;,endPointer);$(&#039;stage&#039;).addEventListener(&#039;pointercancel&#039;,cancelPointer);$(&#039;stageWrap&#039;).addEventListener(&#039;dragover&#039;,e=&gt;{e.preventDefault();$(&#039;stageWrap&#039;).classList.add(&#039;drag-hover&#039;);});$(&#039;stageWrap&#039;).addEventListener(&#039;dragleave&#039;,()=&gt;$(&#039;stageWrap&#039;).classList.remove(&#039;drag-hover&#039;));$(&#039;stageWrap&#039;).addEventListener(&#039;drop&#039;,e=&gt;{e.preventDefault();$(&#039;stageWrap&#039;).classList.remove(&#039;drag-hover&#039;);importFiles(e.dataTransfer.files);});document.addEventListener(&#039;keydown&#039;,canvasKeyboard);window.addEventListener(&#039;pagehide&#039;,event=&gt;{if(!event.persisted){downloads.forEach(url=&gt;URL.revokeObjectURL(url));downloads=[];releaseCuts();}});\r\n\/\/ Only same-origin navigation supplied by the hosting page may populate companion links.\r\nconst config=window.SHANDE_IMAGE_WORKSPACE||{};[[&#039;marketingUrl&#039;,&#039;marketingLink&#039;],[&#039;paletteUrl&#039;,&#039;paletteLink&#039;]].forEach(([key,id])=&gt;{try{if(!config[key])return;const url=new URL(config[key],location.href);if(url.origin===location.origin&amp;&amp;\/^https?:$\/.test(url.protocol)){$(id).href=url.href;$(id).hidden=false;}}catch(e){}});\r\n\r\non(&#039;downloadSelection&#039;,downloadCurrentSelection);on(&#039;queueSelection&#039;,()=&gt;addCurrentCut(false));on(&#039;queueExport&#039;,downloadCutQueue);on(&#039;queueUndo&#039;,undoCut);on(&#039;queueRedo&#039;,redoCut);on(&#039;queueClear&#039;,clearCuts);on(&#039;mobilePropertiesToggle&#039;,()=&gt;{$(&#039;propertiesDrawer&#039;).classList.contains(&#039;open&#039;)?closeProperties():openProperties();});on(&#039;propertiesClose&#039;,closeProperties);on(&#039;drawerBackdrop&#039;,closeProperties);on(&#039;zoomIn&#039;,()=&gt;zoomBy(1.25));on(&#039;zoomOut&#039;,()=&gt;zoomBy(.8));on(&#039;saveProjectMobile&#039;,saveProject);on(&#039;showLayers&#039;,()=&gt;{$(&#039;layersDetails&#039;).open=true;openProperties();});on(&#039;applyCropInPanel&#039;,()=&gt;$(&#039;cropSelection&#039;).click());document.querySelectorAll(&#039;.mode-button&#039;).forEach(button=&gt;button.addEventListener(&#039;click&#039;,()=&gt;{setMode(button.dataset.mode);if(button.dataset.mode!==&#039;selection&#039;)openProperties();else closeProperties();}));\r\nconst JSZip=window.JSZip;\r\n\r\nconst MB = 1024 * 1024;\r\nconst MAX_PACKAGE = 40 * MB, MAX_FONT = 16 * MB, MAX_TOTAL = 64 * MB;\r\nconst fontExtension = \/\\.(ttf|otf|woff2?)$\/i;\r\nconst allowedFontPath = name =&gt; fontExtension.test(name) &amp;&amp; !String(name).replace(\/\\\\\/g,&#039;\/&#039;).split(&#039;\/&#039;).some(part=&gt;part===&#039;..&#039;||part.startsWith(&#039;.&#039;)||part===&#039;__MACOSX&#039;);\r\nconst safeLabel = value =&gt; String(value || &#039;&#039;).replace(\/[\\u0000-\\u001f]\/g, &#039;&#039;).slice(0, 180);\r\nfunction validFontRef(value) {\r\n  if (!value || !Number.isSafeInteger(Number(value.productId)) || Number(value.productId) &lt; 1 || !\/^[a-f0-9]{64}$\/.test(value.hash || &#039;&#039;) || !fontExtension.test(value.fileName || &#039;&#039;)) return null;\r\n  const productId = Number(value.productId), hash = value.hash;\r\n  return { productId, licenseKey: safeLabel(value.licenseKey), fileName: safeLabel(value.fileName), label: safeLabel(value.label), family: `sd_site_${productId}_${hash.slice(0, 16)}`, hash, actualFamily: safeLabel(value.actualFamily) };\r\n}\r\nfunction signature(bytes) { return String.fromCharCode(...new Uint8Array(bytes, 0, Math.min(4, bytes.byteLength))); }\r\nfunction validateFontBytes(buffer) {\r\n  if (!(buffer instanceof ArrayBuffer) || buffer.byteLength &lt; 12 || buffer.byteLength &gt; MAX_FONT) throw Error(&#039;\u5355\u4e2a\u5b57\u4f53\u9700\u4e3a 16 MB \u4ee5\u5185\u7684 TTF\u3001OTF\u3001WOFF \u6216 WOFF2\u3002&#039;);\r\n  if (![&#039;\\u0000\\u0001\\u0000\\u0000&#039;,&#039;OTTO&#039;,&#039;true&#039;,&#039;wOFF&#039;,&#039;wOF2&#039;].includes(signature(buffer))) throw Error(&#039;\u6587\u4ef6\u5185\u5bb9\u4e0d\u662f\u652f\u6301\u7684\u5b57\u4f53\u683c\u5f0f\u3002&#039;);\r\n}\r\nfunction checkFontZip(buffer) {\r\n  const v = new DataView(buffer); let end = -1;\r\n  for (let p = v.byteLength - 22; p &gt;= Math.max(0, v.byteLength - 65557); p--) if (v.getUint32(p, true) === 0x06054b50) { end = p; break; }\r\n  if (end &lt; 0) throw Error(&#039;\u5b57\u4f53\u8d44\u6599\u5305\u4e0d\u662f\u6709\u6548\u7684 ZIP\u3002&#039;);\r\n  const count = v.getUint16(end + 10, true), offset = v.getUint32(end + 16, true);\r\n  if (v.getUint16(end+4,true)!==0 || v.getUint16(end+6,true)!==0 || v.getUint16(end+8,true)!==count || offset+v.getUint32(end+12,true)&gt;end || count &gt; 200 || count === 65535 || offset &gt;= v.byteLength) throw Error(&#039;\u5b57\u4f53\u8d44\u6599\u5305\u76ee\u5f55\u8d85\u8fc7 200 \u9879\uff0c\u8bf7\u4f7f\u7528\u7cbe\u7b80\u5b57\u4f53\u5305\u3002&#039;);\r\n  let pos = offset, total = 0, fonts = 0;\r\n  for (let i = 0; i &lt; count; i++) {\r\n    if (pos + 46 &gt; v.byteLength || v.getUint32(pos, true) !== 0x02014b50) throw Error(&#039;\u5b57\u4f53\u8d44\u6599\u5305\u76ee\u5f55\u635f\u574f\u3002&#039;);\r\n    const flags = v.getUint16(pos + 8, true), compressed = v.getUint32(pos + 20, true), size = v.getUint32(pos + 24, true), names = v.getUint16(pos + 28, true), extra = v.getUint16(pos + 30, true), comment = v.getUint16(pos + 32, true);\r\n    if (pos + 46 + names + extra + comment &gt; v.byteLength || flags &amp; 1 || size === 0xffffffff) throw Error(&#039;\u5b57\u4f53\u8d44\u6599\u5305\u52a0\u5bc6\u6216\u683c\u5f0f\u4e0d\u652f\u6301\u3002&#039;);\r\n    const name = new TextDecoder().decode(new Uint8Array(buffer, pos + 46, names));\r\n    if (allowedFontPath(name)) {\r\n      fonts++; total += size;\r\n      if (fonts &gt; 30 || size &gt; MAX_FONT || total &gt; MAX_TOTAL || (compressed &gt; 0 &amp;&amp; size \/ compressed &gt; 200)) throw Error(&#039;\u5b57\u4f53\u5305\u8bf7\u63a7\u5236\u5728 30 \u4e2a\u5b57\u4f53\u3001\u6bcf\u4e2a 16 MB\u3001\u5408\u8ba1 64 MB \u4ee5\u5185\u3002&#039;);\r\n    }\r\n    pos += 46 + names + extra + comment;\r\n  }\r\n  if (!fonts) throw Error(&#039;\u8d44\u6599\u5305\u5185\u6ca1\u6709 TTF\u3001OTF\u3001WOFF \u6216 WOFF2 \u5b57\u4f53\u3002&#039;);\r\n}\r\nasync function nameTable(buffer) {\r\n  const view = new DataView(buffer), sig = signature(buffer); let offset = 0, length = 0, compressedLength = 0;\r\n  if (sig === &#039;wOF2&#039;) return null;\r\n  const woff = sig === &#039;wOFF&#039;, count = view.getUint16(woff ? 12 : 4), tableStart = woff ? 44 : 12, stride = woff ? 20 : 16;\r\n  if (count &gt; 256 || tableStart + count * stride &gt; buffer.byteLength) return null;\r\n  for (let i = 0; i &lt; count; i++) {\r\n    const pos = tableStart + i * stride;\r\n    if (String.fromCharCode(...new Uint8Array(buffer, pos, 4)) !== &#039;name&#039;) continue;\r\n    offset = view.getUint32(pos + (woff ? 4 : 8)); length = view.getUint32(pos + (woff ? 12 : 12)); compressedLength = woff ? view.getUint32(pos + 8) : length; break;\r\n  }\r\n  if (!length || length &gt; MB || offset + compressedLength &gt; buffer.byteLength) return null;\r\n  let data = buffer.slice(offset, offset + compressedLength);\r\n  if (compressedLength !== length) {\r\n    if (typeof DecompressionStream === &#039;undefined&#039;) return null;\r\n    try { const reader=new Blob([data]).stream().pipeThrough(new DecompressionStream(&#039;deflate&#039;)).getReader(),parts=[];let size=0;try{while(true){const p=await reader.read();if(p.done)break;size+=p.value.byteLength;if(size&gt;length||size&gt;MB){await reader.cancel();return null;}parts.push(p.value);}}finally{reader.releaseLock();}data=await new Blob(parts).arrayBuffer(); } catch { return null; }\r\n    if (data.byteLength !== length) return null;\r\n  }\r\n  return data;\r\n}\r\nasync function actualFontFamily(buffer) {\r\n  try {\r\n    const table = await nameTable(buffer); if (!table || table.byteLength &lt; 6) return &#039;&#039;;\r\n    const view = new DataView(table), count = view.getUint16(2), offset = view.getUint16(4), names = [];\r\n    if (count &gt; 2048 || 6 + count * 12 &gt; table.byteLength) return &#039;&#039;;\r\n    for (let i = 0; i &lt; count; i++) {\r\n      const pos = 6 + i * 12, platform = view.getUint16(pos), language = view.getUint16(pos + 4), nameId = view.getUint16(pos + 6), length = view.getUint16(pos + 8), start = offset + view.getUint16(pos + 10);\r\n      if (![1,16].includes(nameId) || start + length &gt; table.byteLength || length &gt; 1024) continue;\r\n      const bytes = new Uint8Array(table, start, length); let value = &#039;&#039;;\r\n      if (platform === 0 || platform === 3) { for (let j = 0; j + 1 &lt; bytes.length; j += 2) value += String.fromCharCode(bytes[j] * 256 + bytes[j+1]); }\r\n      else if (platform === 1) value = new TextDecoder(&#039;macintosh&#039;).decode(bytes);\r\n      value = safeLabel(value); if (value) names.push({value, score: (nameId === 16 ? 100 : 0) + (language === 0x409 ? 20 : 0) + (platform === 3 ? 10 : 0)});\r\n    }\r\n    return names.sort((a,b) =&gt; b.score - a.score)[0]?.value || &#039;&#039;;\r\n  } catch { return &#039;&#039;; }\r\n}\r\nasync function parseFontPackage(blob, filename = &#039;&#039;) {\r\n  if (!(blob instanceof Blob) || !blob.size || blob.size &gt; MAX_PACKAGE) throw Error(&#039;\u5b57\u4f53\u539f\u6587\u4ef6\u4e3a\u7a7a\u6216\u8d85\u8fc7 40 MB\u3002&#039;);\r\n  const buffer = await blob.arrayBuffer(), entries = [];\r\n  if (signature(buffer).startsWith(&#039;PK&#039;)) {\r\n    checkFontZip(buffer); const zip = await JSZip.loadAsync(buffer); let total = 0;\r\n    for (const file of Object.values(zip.files)) {\r\n      if (file.dir || !allowedFontPath(file.name)) continue;\r\n      let size = 0; const parts = [];\r\n      await new Promise((resolve,reject) =&gt; { const stream = file.internalStream(&#039;uint8array&#039;); let stopped = false; stream.on(&#039;data&#039;, part =&gt; { if (stopped) return; size += part.length; total += part.length; if (size &gt; MAX_FONT || total &gt; MAX_TOTAL) { stopped = true; stream.pause(); reject(Error(&#039;\u5b57\u4f53\u5305\u5b9e\u9645\u5c55\u5f00\u5927\u5c0f\u8d85\u8fc7\u4e0a\u9650\u3002&#039;)); } else parts.push(part); }).on(&#039;error&#039;,reject).on(&#039;end&#039;,() =&gt; { if (!stopped) resolve(); }).resume(); });\r\n      const bytes = await new Blob(parts).arrayBuffer(); validateFontBytes(bytes); entries.push({fileName:safeLabel(file.name),bytes,actualFamily:await actualFontFamily(bytes)});\r\n      if (entries.length &gt; 30) throw Error(&#039;\u5b57\u4f53\u5305\u8d85\u8fc7 30 \u4e2a\u5b57\u4f53\u3002&#039;);\r\n    }\r\n  } else {\r\n    validateFontBytes(buffer); const ext = {&#039;wOFF&#039;:&#039;woff&#039;,&#039;wOF2&#039;:&#039;woff2&#039;,&#039;OTTO&#039;:&#039;otf&#039;}[signature(buffer)] || &#039;ttf&#039;;\r\n    entries.push({fileName:safeLabel(fontExtension.test(filename) ? filename : (filename || &#039;\u672c\u7ad9\u5b57\u4f53&#039;) + &#039;.&#039; + ext), bytes:buffer, actualFamily:await actualFontFamily(buffer)});\r\n  }\r\n  if (!entries.length) throw Error(&#039;\u6ca1\u6709\u8bfb\u53d6\u5230\u53ef\u7528\u5b57\u4f53\u3002&#039;); return entries;\r\n}\r\nasync function loadFontVariant(entry, productId, title, licenseKey = &#039;&#039;) {\r\n  validateFontBytes(entry.bytes); if (!Number.isSafeInteger(Number(productId)) || Number(productId) &lt; 1) throw Error(&#039;\u5b57\u4f53\u6765\u6e90\u7f16\u53f7\u65e0\u6548\u3002&#039;);\r\n  if (typeof FontFace === &#039;undefined&#039; || !document.fonts || !globalThis.crypto?.subtle) throw Error(&#039;\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u80fd\u52a0\u8f7d\u672c\u7ad9\u5b57\u4f53\uff0c\u8bf7\u4f7f\u7528\u65b0\u7248\u6d4f\u89c8\u5668\u3002&#039;);\r\n  const hash = Array.from(new Uint8Array(await crypto.subtle.digest(&#039;SHA-256&#039;, entry.bytes)), b =&gt; b.toString(16).padStart(2,&#039;0&#039;)).join(&#039;&#039;);\r\n  const family = `sd_site_${Number(productId)}_${hash.slice(0,16)}`, face = new FontFace(family, entry.bytes);\r\n  await face.load(); document.fonts.add(face); await document.fonts.load(`16px &quot;${family}&quot;`);\r\n  const ref = {productId:Number(productId),licenseKey:safeLabel(licenseKey),fileName:safeLabel(entry.fileName),label:safeLabel(title ? `${title} \u00b7 ${entry.actualFamily || entry.fileName.replace(\/^.*\\\/\/,&#039;&#039;)}` : entry.actualFamily || entry.fileName),family,hash,actualFamily:safeLabel(entry.actualFamily)};\r\n  return {ref,face,bytes:entry.bytes};\r\n}\r\n\r\n\r\nfunction updateSelectionToolHint(){\r\n  if(workspaceMode!==&#039;selection&#039;||![&#039;rect&#039;,&#039;ellipse&#039;,&#039;lasso&#039;].includes(tool))return;\r\n  const action=tool===&#039;rect&#039;?&#039;\u62d6\u51fa\u77e9\u5f62&#039;:tool===&#039;ellipse&#039;?&#039;\u62d6\u51fa\u692d\u5706&#039;:&#039;\u6cbf\u8f6e\u5ed3\u5708\u9009&#039;,mode=$(&#039;selectionCombineMode&#039;).value,automatic=$(&#039;autoSlice&#039;).checked&amp;&amp;mode===&#039;new&#039;;\r\n  const purpose=mode===&#039;add&#039;?&#039;\uff0c\u589e\u52a0\u5230\u5f53\u524d\u9009\u533a&#039;:mode===&#039;subtract&#039;?&#039;\uff0c\u4ece\u5f53\u524d\u9009\u533a\u51cf\u53bb&#039;:&#039;&#039;;\r\n  $(&#039;toolHint&#039;).textContent=action+purpose+(automatic?&#039;\uff0c\u677e\u5f00\u81ea\u52a8\u52a0\u5165\u5207\u7247\u6e05\u5355\u3002&#039;:&#039;\uff0c\u5b8c\u6210\u540e\u70b9\u51fb\u201c\u52a0\u5165\u5207\u7247\u6e05\u5355\u201d\u3002&#039;)+(tool===&#039;ellipse&#039;?&#039;\u6309\u4f4f Shift \u53ef\u753b\u6b63\u5706\u3002&#039;:&#039;&#039;)+&#039;\u539f\u56fe\u4fdd\u7559\u3002&#039;;\r\n}\r\n$(&#039;autoSlice&#039;).addEventListener(&#039;change&#039;,updateSelectionToolHint);\r\nfunction refineCompletedSelection(previous){\r\n  if(!selection||workspaceMode!==&#039;selection&#039;)return;\r\n  const mode=$(&#039;selectionCombineMode&#039;).value,current=selection;\r\n  if(mode!==&#039;new&#039;&amp;&amp;previous){const parts=previous.type===&#039;compound&#039;?previous.parts.slice():[{op:&#039;add&#039;,selection:previous}];if(parts.length&gt;=24){selection=previous;show(&#039;\u9009\u533a\u64cd\u4f5c\u6700\u591a24\u6b65\uff0c\u8bf7\u5148\u52a0\u5165\u6e05\u5355\u3002&#039;,true);return;}parts.push({op:mode,selection:current});selection={type:&#039;compound&#039;,parts};}\r\n  else if(mode===&#039;subtract&#039;&amp;&amp;!previous){selection=null;show(&#039;\u5148\u65b0\u5efa\u4e00\u4e2a\u9009\u533a\uff0c\u518d\u9009\u62e9\u51cf\u53bb\u3002&#039;,true);return;}\r\n  selection.feather=Math.max(0,Math.min(24,Number($(&#039;selectionFeather&#039;).value)||0));\r\n  const l=active();if(l?.type===&#039;image&#039;){const b=C.selectionBounds(selection,l.image);Object.assign(selection,b);}\r\n  lastSelectionQueued=false;lastQueuedCutId=null;\r\n}\r\nfunction refreshCurrentSelectionPiece(){\r\n  if(!selection||workspaceMode!==&#039;selection&#039;)return;\r\n  selection.feather=Math.max(0,Math.min(24,Number($(&#039;selectionFeather&#039;).value)||0));\r\n  const piece=lastSelectionQueued&amp;&amp;cutQueue.find(p=&gt;p.id===lastQueuedCutId),l=active();\r\n  if(piece&amp;&amp;l?.type===&#039;image&#039;){try{const fresh=C.createSelectionPiece(l.image,selection,piece.name,cutQueue.filter(p=&gt;p!==piece),{padding:selectionPadding()});C.release(piece.canvas);Object.assign(piece,fresh);markChanged();renderCuts();}catch(error){show(error.message,true);}}\r\n  draw();\r\n}\r\non(&#039;cancelCrop&#039;,()=&gt;{selection=null;lastSelectionQueued=false;setTool(&#039;move&#039;);show(&#039;\u5df2\u53d6\u6d88\u88c1\u526a\u3002&#039;);});\r\n$(&#039;cropRatio&#039;).addEventListener(&#039;change&#039;,()=&gt;{const l=active();if(!l||l.type!==&#039;image&#039;)return;const value=$(&#039;cropRatio&#039;).value.split(&#039;:&#039;).map(Number);if(value.length!==2||!value.every(v=&gt;v&gt;0))return;const old=selection?.type===&#039;rect&#039;?selection:{x:0,y:0,width:l.image.width,height:l.image.height};const ratio=value[0]\/value[1];let w=old.width,h=w\/ratio;if(h&gt;old.height){h=old.height;w=h*ratio;}if(tool!==&#039;rect&#039;)setTool(&#039;rect&#039;);selection={type:&#039;rect&#039;,x:old.x+(old.width-w)\/2,y:old.y+(old.height-h)\/2,width:w,height:h};syncInspector();draw();});\r\n$(&#039;selectionCombineMode&#039;).addEventListener(&#039;change&#039;,()=&gt;{if($(&#039;selectionCombineMode&#039;).value!==&#039;new&#039;)$(&#039;autoSlice&#039;).checked=false;lastSelectionQueued=false;lastQueuedCutId=null;updateSelectionToolHint();show($(&#039;selectionCombineMode&#039;).value===&#039;new&#039;?&#039;\u753b\u51fa\u65b0\u7684\u9009\u533a\u3002&#039;:&#039;\u7ee7\u7eed\u753b\u9009\u533a\uff0c\u5b8c\u6210\u540e\u70b9\u51fb\u201c\u52a0\u5165\u5207\u7247\u6e05\u5355\u201d\u3002&#039;);});\r\n$(&#039;selectionFeather&#039;).addEventListener(&#039;change&#039;,refreshCurrentSelectionPiece);\r\non(&#039;selectionUndoPart&#039;,()=&gt;{if(selection?.type===&#039;compound&#039;&amp;&amp;selection.parts.length&gt;1){selection.parts.pop();const b=C.selectionBounds(selection,imageLayer().image);Object.assign(selection,b);lastSelectionQueued=false;lastQueuedCutId=null;draw();show(&#039;\u5df2\u64a4\u9500\u6700\u8fd1\u4e00\u6b21\u9009\u533a\u589e\u51cf\u3002&#039;);}else{selection=null;draw();}});\r\n\r\n\/\/ Original inline material browser and site-font adapter. Data and bytes come only from the host&#039;s native gateway.\r\nconst materialPanel={page:1,hasMore:false,items:[],categories:[],busy:false,loaded:false,productId:0};\r\nconst fontPanel={page:1,hasMore:false,items:[],busy:false,loaded:false,package:null,product:null,productId:0};\r\nconst siteFontFaces=new Map(),siteFontPackages=new Map();\r\nconst recentSiteMaterials=new Map(),loadedFontVariants=new Map();\r\nlet fontTaskBusy=false,lastCatalogRefresh=0,catalogPurchasePending=false,initialCatalogApplied=false;\r\nconst imagePackageState={entries:[],item:null,licenseKey:&#039;&#039;,scope:&#039;&#039;,busy:false,previewUrls:[]};\r\nfunction normalizeSiteFontRef(value){\r\n  if(!value||typeof value!==&#039;object&#039;||!Number.isSafeInteger(Number(value.productId))||Number(value.productId)&lt;1||typeof value.hash!==&#039;string&#039;||!\/^[a-f0-9]{64}$\/.test(value.hash)||typeof value.fileName!==&#039;string&#039;||value.fileName.length&gt;512||typeof value.licenseKey!==&#039;string&#039;||value.licenseKey.length&gt;100)return null;\r\n  const productId=Number(value.productId),family=&#039;sd_site_&#039;+productId+&#039;_&#039;+value.hash.slice(0,16);\r\n  return{productId,licenseKey:value.licenseKey,fileName:value.fileName,label:String(value.label||&#039;\u672c\u7ad9\u5b57\u4f53&#039;).slice(0,240),family,hash:value.hash,actualFamily:String(value.actualFamily||&#039;&#039;).slice(0,160)};\r\n}\r\nfunction missingSiteFonts(layerOnly=false){\r\n  const layers=layerOnly?[active()].filter(Boolean):scene.layers.filter(l=&gt;l.visible!==false);\r\n  const refs=new Map();layers.forEach(l=&gt;{if(l.type===&#039;text&#039;&amp;&amp;l.fontRef&amp;&amp;!siteFontFaces.has(l.fontRef.family))refs.set(l.fontRef.family,l.fontRef);});return [...refs.values()];\r\n}\r\nfunction refreshFontNotice(){\r\n  const missing=missingSiteFonts(),notice=$(&#039;siteFontNotice&#039;);if(!notice)return;\r\n  notice.hidden=!missing.length&amp;&amp;!fontTaskBusy;\r\n  $(&#039;siteFontNoticeText&#039;).textContent=fontTaskBusy?&#039;\u6b63\u5728\u51c6\u5907\u672c\u7ad9\u5b57\u4f53\uff0c\u8bf7\u7a0d\u5019\u2026&#039;:missing.length?&#039;\u6b64\u9879\u76ee\u6709 &#039;+missing.length+&#039; \u6b3e\u672c\u7ad9\u5b57\u4f53\u5c1a\u672a\u52a0\u8f7d\u3002\u5f53\u524d\u6587\u5b57\u4e3a\u4e34\u65f6\u66ff\u4ee3\u9884\u89c8\uff0c\u5bfc\u51fa\u524d\u8bf7\u6062\u590d\u5b57\u4f53\u3002&#039;:&#039;&#039;;\r\n  $(&#039;restoreSiteFonts&#039;).disabled=fontTaskBusy||!missing.length;\r\n}\r\nfunction ensureSiteFontOption(ref){\r\n  if(!ref)return;const select=$(&#039;textFont&#039;);let option=Array.from(select.options).find(o=&gt;o.value===ref.family);\r\n  if(!option){option=document.createElement(&#039;option&#039;);option.value=ref.family;select.append(option);}\r\n  option.textContent=ref.label+(siteFontFaces.has(ref.family)?&#039; \u00b7 \u672c\u7ad9&#039;:&#039; \u00b7 \u5f85\u6062\u590d&#039;);option.disabled=!siteFontFaces.has(ref.family);\r\n}\r\nfunction checkedProductUrl(value){try{const url=new URL(value,expectedHostOrigin);return url.origin===expectedHostOrigin&amp;&amp;!url.username&amp;&amp;!url.password?url.href:null;}catch(_){return null;}}\r\nfunction libraryEmpty(container,text){const node=document.createElement(&#039;div&#039;);node.className=&#039;siw-library-empty&#039;;node.textContent=text;container.append(node);}\r\nfunction renderCatalogCategories(categories){\r\n  const select=$(&#039;assetCategory&#039;),selected=select.value;\r\n  const values=Array.isArray(categories)?categories:[];\r\n  select.replaceChildren();const all=document.createElement(&#039;option&#039;);all.value=&#039;&#039;;all.textContent=&#039;\u5168\u90e8\u56fe\u7247\u5206\u7c7b&#039;;select.append(all);\r\n  values.forEach(category=&gt;{if(!Number.isSafeInteger(Number(category.id))||Number(category.id)&lt;1)return;const option=document.createElement(&#039;option&#039;);option.value=String(category.id);option.textContent=String(category.name||&#039;&#039;).slice(0,100);select.append(option);});\r\n  if([...select.options].some(option=&gt;option.value===selected))select.value=selected;\r\n}\r\nfunction applyInitialCatalogAsset(value){\r\n  if(initialCatalogApplied||!value||![&#039;image&#039;,&#039;font&#039;].includes(value.kind)||!Number.isSafeInteger(Number(value.productId))||Number(value.productId)&lt;1)return;\r\n  initialCatalogApplied=true;const fonts=value.kind===&#039;font&#039;,state=fonts?fontPanel:materialPanel;\r\n  state.productId=Number(value.productId);state.page=1;state.loaded=false;\r\n  if(fonts){setMode(&#039;text&#039;);$(&#039;siteFontsDetails&#039;).open=true;loadSiteCatalog(&#039;font&#039;);}\r\n  else{setMode(&#039;assets&#039;);}\r\n  openProperties();\r\n}\r\nfunction siteMaterialSupported(item,fonts=false){return (fonts?[&#039;ttf&#039;,&#039;otf&#039;,&#039;woff&#039;,&#039;woff2&#039;,&#039;zip&#039;]:[&#039;png&#039;,&#039;jpg&#039;,&#039;jpeg&#039;,&#039;webp&#039;,&#039;zip&#039;]).includes(String(item.extension||&#039;&#039;).toLowerCase());}\r\nfunction productLabel(item){return item.accessLabel||(item.isFree?&#039;\u514d\u8d39\u7d20\u6750&#039;:item.canUse?&#039;\u5df2\u83b7\u6388\u6743&#039;:&#039;\u9700\u8d2d\u4e70\u6388\u6743&#039;);}\r\nfunction openMaterialProduct(item,kind){\r\n  catalogPurchasePending=true;\r\n  return requestHostOperation(&#039;catalog-product&#039;,{productId:item.productId,kind});\r\n}\r\nfunction renderSiteCatalog(kind){\r\n  const fonts=kind===&#039;font&#039;,state=fonts?fontPanel:materialPanel,box=$(fonts?&#039;fontGrid&#039;:&#039;assetGrid&#039;);box.replaceChildren();\r\n  box.setAttribute(&#039;aria-busy&#039;,String(state.busy));\r\n  if(!state.items.length)libraryEmpty(box,fonts?&#039;\u6ca1\u6709\u627e\u5230\u5339\u914d\u7684\u672c\u7ad9\u5b57\u4f53\uff0c\u53ef\u6362\u4e2a\u5173\u952e\u8bcd\u6216\u7a0d\u540e\u5237\u65b0\u3002&#039;:&#039;\u5f53\u524d\u7b5b\u9009\u6ca1\u6709\u7d20\u6750\u3002\u53ef\u5207\u6362\u5206\u7c7b\u3001\u514d\u8d39\u6216\u5df2\u8d2d\u8303\u56f4\uff0c\u6216\u6e05\u7a7a\u5173\u952e\u8bcd\u3002&#039;);\r\n  state.items.forEach(item=&gt;{\r\n    const card=document.createElement(&#039;article&#039;);card.className=&#039;siw-library-card&#039;;\r\n    if(!fonts){const thumb=document.createElement(&#039;img&#039;);thumb.addEventListener(&#039;click&#039;,()=&gt;previewCatalogItem(item));thumb.alt=item.title+&#039; \u5546\u54c1\u9884\u89c8&#039;;thumb.loading=&#039;lazy&#039;;try{const u=new URL(item.previewUrl);if(u.protocol===&#039;https:&#039;&amp;&amp;!u.username&amp;&amp;!u.password){thumb.src=u.href;thumb.referrerPolicy=&#039;no-referrer&#039;;}}catch(_){}card.append(thumb);}\r\n    const title=document.createElement(&#039;strong&#039;);title.textContent=item.title;card.append(title);\r\n    const badges=document.createElement(&#039;div&#039;);badges.className=&#039;siw-library-badges&#039;;const badge=document.createElement(&#039;span&#039;);badge.className=&#039;siw-library-badge&#039;;badge.dataset.ready=String(item.canUse===true);badge.textContent=productLabel(item);badges.append(badge);\r\n    if(item.extension){const format=document.createElement(&#039;span&#039;);format.className=&#039;siw-library-badge&#039;;format.textContent=String(item.extension).toUpperCase();badges.append(format);}card.append(badges);\r\n    const categoryNames=(item.categories||[]).map(category=&gt;category.name).filter(Boolean);\r\n    if(categoryNames.length||item.priceLabel){const meta=document.createElement(&#039;span&#039;);meta.className=&#039;siw-library-meta&#039;;meta.textContent=[categoryNames.slice(-2).join(&#039; \/ &#039;),item.isFree?&#039;&#039;:item.priceLabel].filter(Boolean).join(&#039; \u00b7 &#039;);card.append(meta);}\r\n    if(fonts){const specimen=document.createElement(&#039;div&#039;);specimen.className=&#039;font-specimen&#039;;const loaded=[...siteFontFaces.values()].find(v=&gt;v.ref.productId===Number(item.productId));if(loaded){specimen.style.fontFamily=&#039;&quot;&#039;+loaded.ref.family+&#039;&quot;&#039;;specimen.textContent=(active()?.text||&#039;\u95ea\u5f97\u7d20\u6750 \u00b7 \u521b\u4f5c\u7075\u611f&#039;).slice(0,40);}else{specimen.textContent=&#039;\u9009\u62e9\u540e\u9884\u89c8\u771f\u5b9e\u5b57\u6837&#039;;specimen.style.fontSize=&#039;12px&#039;;specimen.style.color=&#039;#738093&#039;;}card.append(specimen);}\r\n    const productUrl=checkedProductUrl(item.productUrl);\r\n    if(productUrl){const link=document.createElement(&#039;a&#039;);link.className=&#039;siw-product-link&#039;;link.href=productUrl;link.target=&#039;_blank&#039;;link.rel=&#039;noopener noreferrer&#039;;link.textContent=item.canUse||item.isFree?&#039;\u67e5\u770b\u5546\u54c1\u4e0e\u6388\u6743&#039;:&#039;\u67e5\u770b \/ \u8d2d\u4e70\u6388\u6743&#039;;link.addEventListener(&#039;click&#039;,event=&gt;{event.preventDefault();openMaterialProduct(item,kind).catch(error=&gt;show(error.message,true));});card.append(link);}\r\n    const choices=document.createElement(&#039;select&#039;);choices.setAttribute(&#039;aria-label&#039;,item.title+&#039; \u7684\u6388\u6743&#039;);(item.licenseOptions||[]).forEach(v=&gt;{const o=document.createElement(&#039;option&#039;);o.value=v.key;o.textContent=v.label;choices.append(o);});if(choices.options.length)card.append(choices);\r\n    const action=document.createElement(&#039;button&#039;);action.type=&#039;button&#039;;const supported=siteMaterialSupported(item,fonts);\r\n    action.textContent=!supported?&#039;\u5230\u5546\u54c1\u9875\u67e5\u770b\u539f\u6587\u4ef6&#039;:!item.canUse?(creativeBoot.mode===&#039;trial&#039;?&#039;\u767b\u5f55\u540e\u4f7f\u7528&#039;:item.isFree?&#039;\u67e5\u770b\u4f7f\u7528\u6761\u4ef6&#039;:&#039;\u67e5\u770b \/ \u8d2d\u4e70\u6388\u6743&#039;):fonts?&#039;\u9009\u62e9\u672c\u7ad9\u5b57\u4f53&#039;:item.extension===&#039;zip&#039;?&#039;\u9009\u62e9\u5305\u5185\u56fe\u7247&#039;:&#039;\u63d2\u5165\u539f\u56fe&#039;;\r\n    action.disabled=state.busy||(item.canUse&amp;&amp;supported&amp;&amp;!choices.options.length);\r\n    action.addEventListener(&#039;click&#039;,async()=&gt;{\r\n      if(state.busy||fontTaskBusy)return;\r\n      if(!supported||!item.canUse){if(creativeBoot.mode===&#039;trial&#039;&amp;&amp;supported){await requestHostOperation(&#039;membership&#039;).catch(error=&gt;show(error.message,true));}else await openMaterialProduct(item,kind).catch(error=&gt;show(error.message,true));return;}\r\n      state.busy=true;action.disabled=true;const status=$(fonts?&#039;fontStatus&#039;:&#039;assetStatus&#039;);status.textContent=fonts?&#039;\u6b63\u5728\u53d6\u5f97\u5df2\u6388\u6743\u5b57\u4f53\u6587\u4ef6\u2026&#039;:&#039;\u6b63\u5728\u53d6\u5f97\u6240\u9009\u6388\u6743\u7684\u539f\u6587\u4ef6\u2026&#039;;\r\n      try{if(fonts)await selectFontProduct(item,choices.value);else await insertSiteMaterial(item,choices.value);}\r\n      catch(error){status.textContent=error.message||&#039;\u7d20\u6750\u8bfb\u53d6\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\u3002&#039;;}\r\n      finally{state.busy=false;renderSiteCatalog(kind);}\r\n    });\r\n    if(!fonts&amp;&amp;supported&amp;&amp;item.canUse&amp;&amp;choices.options.length){card.draggable=true;card.addEventListener(&#039;dragstart&#039;,event=&gt;{event.dataTransfer.setData(&#039;application\/x-shande-material&#039;,JSON.stringify({productId:item.productId,licenseKey:choices.value}));event.dataTransfer.effectAllowed=&#039;copy&#039;;});}\r\n    card.append(action);box.append(card);\r\n  });\r\n  $(fonts?&#039;fontPage&#039;:&#039;assetPage&#039;).textContent=&#039;\u7b2c &#039;+state.page+&#039; \u9875&#039;;$(fonts?&#039;fontPrev&#039;:&#039;assetPrev&#039;).disabled=state.busy||state.page&lt;=1;$(fonts?&#039;fontNext&#039;:&#039;assetNext&#039;).disabled=state.busy||!state.hasMore;\r\n  $(fonts?&#039;fontClearLocation&#039;:&#039;assetClearLocation&#039;).hidden=!state.productId;\r\n}\r\nasync function loadSiteCatalog(kind){\r\n  const fonts=kind===&#039;font&#039;,state=fonts?fontPanel:materialPanel;if(state.busy)return;\r\n  state.busy=true;const status=$(fonts?&#039;fontStatus&#039;:&#039;assetStatus&#039;),searchButton=$(fonts?&#039;fontSearchForm&#039;:&#039;assetSearchForm&#039;).querySelector(&#039;button&#039;);searchButton.disabled=true;\r\n  if(!fonts){$(&#039;assetScope&#039;).disabled=true;$(&#039;assetCategory&#039;).disabled=true;}\r\n  $(fonts?&#039;fontRefresh&#039;:&#039;assetRefresh&#039;).disabled=true;status.textContent=&#039;\u6b63\u5728\u8bfb\u53d6\u672c\u7ad9&#039;+(fonts?&#039;\u5b57\u4f53&#039;:&#039;\u7d20\u6750&#039;)+&#039;\u2026&#039;;\r\n  try{\r\n    const result=await requestHostOperation(&#039;catalog-list&#039;,{kind,tool:&#039;image&#039;,productId:state.productId||0,q:$(fonts?&#039;fontQuery&#039;:&#039;assetQuery&#039;).value.trim().slice(0,100),scope:fonts?&#039;all&#039;:$(&#039;assetScope&#039;).value,category:fonts?&#039;&#039;:$(&#039;assetCategory&#039;).value,page:state.page});\r\n    state.items=Array.isArray(result.items)?result.items:[];state.hasMore=result.hasMore===true;state.loaded=true;\r\n    if(!fonts&amp;&amp;Array.isArray(result.categories)){state.categories=result.categories;renderCatalogCategories(state.categories);}\r\n    status.textContent=state.items.length?(state.productId?&#039;\u5df2\u5b9a\u4f4d\u5546\u54c1 \u00b7 \u8bf7\u70b9\u51fb\u4f7f\u7528\u540e\u9009\u7528\u539f\u6587\u4ef6&#039;:&#039;\u7b2c &#039;+state.page+&#039; \u9875 \u00b7 &#039;+state.items.length+&#039; \u9879 \u00b7 \u539f\u6587\u4ef6\u6309\u5546\u54c1\u6388\u6743\u4f7f\u7528&#039;):state.productId?&#039;\u6b64\u5546\u54c1\u6682\u4e0d\u53ef\u7528\u4e8e\u5f53\u524d\u5de5\u4f5c\u53f0\uff0c\u53ef\u70b9\u51fb\u201c\u67e5\u770b\u5168\u90e8\u201d\u7ee7\u7eed\u9009\u62e9\u3002&#039;:fonts?&#039;\u672c\u7ad9\u5b57\u4f53\u5e93\u6682\u65f6\u6ca1\u6709\u5339\u914d\u9879\u3002&#039;:&#039;\u5f53\u524d\u7b5b\u9009\u6682\u65e0\u5339\u914d\u7d20\u6750\u3002&#039;;lastCatalogRefresh=Date.now();\r\n  }catch(error){state.items=[];state.hasMore=false;status.textContent=(error.message||&#039;\u8bfb\u53d6\u5931\u8d25\u3002&#039;)+&#039; \u53ef\u70b9\u51fb\u201c\u5237\u65b0\u6388\u6743\u201d\u91cd\u8bd5\u3002&#039;;}\r\n  finally{state.busy=false;searchButton.disabled=false;if(!fonts){$(&#039;assetScope&#039;).disabled=false;$(&#039;assetCategory&#039;).disabled=false;}$(fonts?&#039;fontRefresh&#039;:&#039;assetRefresh&#039;).disabled=false;renderSiteCatalog(kind);}\r\n}\r\nfunction refreshVisibleCatalog(){\r\n  if(document.visibilityState===&#039;hidden&#039;||(!catalogPurchasePending&amp;&amp;Date.now()-lastCatalogRefresh&lt;15000))return;\r\n  catalogPurchasePending=false;\r\n  if(workspaceMode===&#039;assets&#039;&amp;&amp;materialPanel.loaded)loadSiteCatalog(&#039;image&#039;);\r\n  if($(&#039;siteFontsDetails&#039;).open&amp;&amp;fontPanel.loaded)loadSiteCatalog(&#039;font&#039;);\r\n}\r\nfunction siteImageType(bytes){\r\n  const b=bytes instanceof Uint8Array?bytes:new Uint8Array(bytes);\r\n  if(b.length&gt;=24&amp;&amp;b[0]===137&amp;&amp;String.fromCharCode(...b.slice(1,8))===&#039;PNG\\r\\n\\x1a\\n&#039;)return &#039;image\/png&#039;;\r\n  if(b.length&gt;=4&amp;&amp;b[0]===255&amp;&amp;b[1]===216&amp;&amp;b[2]===255)return &#039;image\/jpeg&#039;;\r\n  if(b.length&gt;=30&amp;&amp;String.fromCharCode(...b.slice(0,4))===&#039;RIFF&#039;&amp;&amp;String.fromCharCode(...b.slice(8,12))===&#039;WEBP&#039;)return &#039;image\/webp&#039;;\r\n  throw Error(&#039;\u539f\u6587\u4ef6\u4e0d\u662f\u6709\u6548\u7684 PNG\u3001JPG \u6216 WebP \u56fe\u7247\u3002&#039;);\r\n}\r\nfunction imagePackagePath(name){return typeof name===&#039;string&#039;&amp;&amp;name.length&lt;=512&amp;&amp;\/\\.(png|jpe?g|webp)$\/i.test(name)&amp;&amp;!name.includes(&#039;\\0&#039;)&amp;&amp;!\/^(?:[a-z]:|[\\\\\/])\/i.test(name)&amp;&amp;!name.replace(\/\\\\\/g,&#039;\/&#039;).split(&#039;\/&#039;).some(part=&gt;part===&#039;..&#039;||part.startsWith(&#039;.&#039;)||part===&#039;__MACOSX&#039;);}\r\nfunction inspectImageZip(buffer){\r\n  const v=new DataView(buffer);let end=-1;\r\n  for(let p=v.byteLength-22;p&gt;=Math.max(0,v.byteLength-65557);p--)if(v.getUint32(p,true)===0x06054b50&amp;&amp;p+22+v.getUint16(p+20,true)===v.byteLength){end=p;break;}\r\n  if(end&lt;0)throw Error(&#039;\u56fe\u7247\u8d44\u6599\u5305\u4e0d\u662f\u6709\u6548\u7684 ZIP\u3002&#039;);\r\n  const count=v.getUint16(end+10,true),offset=v.getUint32(end+16,true),directorySize=v.getUint32(end+12,true);\r\n  if(v.getUint16(end+4,true)||v.getUint16(end+6,true)||v.getUint16(end+8,true)!==count||!count||count&gt;200||offset+directorySize&gt;end)throw Error(&#039;\u4ec5\u652f\u6301\u4e0d\u52a0\u5bc6\u3001200 \u9879\u4ee5\u5185\u7684\u666e\u901a ZIP \u56fe\u7247\u5305\u3002&#039;);\r\n  let pos=offset,total=0,images=0;const names=new Set();\r\n  for(let i=0;i&lt;count;i++){\r\n    if(pos+46&gt;end||v.getUint32(pos,true)!==0x02014b50)throw Error(&#039;\u56fe\u7247\u5305\u76ee\u5f55\u635f\u574f\u3002&#039;);\r\n    const flags=v.getUint16(pos+8,true),method=v.getUint16(pos+10,true),compressed=v.getUint32(pos+20,true),size=v.getUint32(pos+24,true),length=v.getUint16(pos+28,true),extra=v.getUint16(pos+30,true),comment=v.getUint16(pos+32,true),local=v.getUint32(pos+42,true);\r\n    if(pos+46+length+extra+comment&gt;offset+directorySize||flags&amp;1||![0,8].includes(method)||size===0xffffffff||compressed===0xffffffff||local&gt;=offset)throw Error(&#039;\u56fe\u7247\u5305\u542b\u52a0\u5bc6\u3001\u5206\u5377\u6216\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u3002&#039;);\r\n    const name=new TextDecoder().decode(new Uint8Array(buffer,pos+46,length));\r\n    if(imagePackagePath(name)){\r\n      images++;total+=size;if(names.has(name)||images&gt;40||!size||size&gt;40*MB||total&gt;64*MB||!compressed||size\/compressed&gt;200)throw Error(&#039;\u56fe\u7247\u5305\u9700\u5728 40 \u5f20\u3001\u5355\u5f20 40 MB\u3001\u5408\u8ba1 64 MB \u4ee5\u5185\uff0c\u4e14\u4e0d\u542b\u91cd\u590d\u6587\u4ef6\u3002&#039;);names.add(name);\r\n    }\r\n    pos+=46+length+extra+comment;\r\n  }\r\n  if(pos!==offset+directorySize||!images)throw Error(&#039;\u5305\u5185\u6ca1\u6709\u53ef\u9009\u7684 PNG\u3001JPG \u6216 WebP \u56fe\u7247\u3002&#039;);\r\n  return names;\r\n}\r\nasync function boundedPackageFile(file,limit=40*MB){\r\n  const parts=[];let size=0;\r\n  await new Promise((resolve,reject)=&gt;{const stream=file.internalStream(&#039;uint8array&#039;);let stopped=false;stream.on(&#039;data&#039;,part=&gt;{if(stopped)return;size+=part.length;if(size&gt;limit){stopped=true;stream.pause();reject(Error(&#039;\u5305\u5185\u56fe\u7247\u5b9e\u9645\u5c55\u5f00\u5927\u5c0f\u8d85\u8fc7\u4e0a\u9650\u3002&#039;));}else parts.push(part);}).on(&#039;error&#039;,reject).on(&#039;end&#039;,()=&gt;{if(!stopped)resolve();}).resume();});\r\n  if(!size)throw Error(&#039;\u5305\u5185\u56fe\u7247\u4e3a\u7a7a\u3002&#039;);\r\n  const type=siteImageType(await new Blob(parts).slice(0,32).arrayBuffer());return new Blob(parts,{type});\r\n}\r\nasync function insertSiteMaterial(item,licenseKey){\r\n  if(busy||imagePackageState.busy)throw Error(&#039;\u6b63\u5728\u5904\u7406\u56fe\u7247\uff0c\u8bf7\u7a0d\u540e\u518d\u63d2\u5165\u3002&#039;);\r\n  const result=await requestHostOperation(&#039;catalog-use&#039;,{productId:item.productId,licenseKey});\r\n  if(!(result.blob instanceof Blob)||!result.blob.size||result.blob.size&gt;40*MB)throw Error(&#039;\u6ca1\u6709\u6536\u5230\u6709\u6548\u539f\u6587\u4ef6\u3002&#039;);\r\n  const head=new Uint8Array(await result.blob.slice(0,32).arrayBuffer());\r\n  if(head[0]===80&amp;&amp;head[1]===75){await openImagePackage(result.blob,item,licenseKey);$(&#039;assetStatus&#039;).textContent=&#039;\u5df2\u53d6\u5f97\u6388\u6743\u56fe\u7247\u5305\uff0c\u8bf7\u9009\u62e9\u8981\u63d2\u5165\u7684\u539f\u56fe\u3002&#039;;return;}\r\n  const type=siteImageType(head),extension={&#039;image\/png&#039;:&#039;png&#039;,&#039;image\/jpeg&#039;:&#039;jpg&#039;,&#039;image\/webp&#039;:&#039;webp&#039;}[type];\r\n  const before=new Set(scene.layers.map(layer=&gt;layer.id));await importFiles([new File([result.blob],String(item.title||&#039;\u672c\u7ad9\u539f\u56fe&#039;)+&#039;.&#039;+extension,{type})]);\r\n  if(scene.layers.some(layer=&gt;!before.has(layer.id))){rememberSiteMaterial(item,licenseKey);$(&#039;assetStatus&#039;).textContent=&#039;\u539f\u56fe\u5df2\u63d2\u5165\uff0c\u53ef\u5728\u753b\u5e03\u4e2d\u7ee7\u7eed\u7f16\u8f91\u3002&#039;;}else $(&#039;assetStatus&#039;).textContent=&#039;\u539f\u6587\u4ef6\u5df2\u6536\u5230\uff0c\u5c1a\u672a\u63d2\u5165\u3002\u8bf7\u67e5\u770b\u753b\u5e03\u4e0a\u65b9\u7684\u5904\u7406\u63d0\u793a\u3002&#039;;\r\n}\r\nfunction clearImagePackage(){\r\n  imagePackageState.previewUrls.forEach(url=&gt;URL.revokeObjectURL(url));imagePackageState.previewUrls=[];imagePackageState.entries=[];imagePackageState.item=null;imagePackageState.licenseKey=&#039;&#039;;imagePackageState.scope=&#039;&#039;;$(&#039;imagePackageList&#039;).replaceChildren();\r\n}\r\nfunction closeImagePackage(){if(!imagePackageState.busy)$(&#039;imagePackageDialog&#039;).close();}\r\nasync function openImagePackage(blob,item,licenseKey){\r\n  const buffer=await blob.arrayBuffer();inspectImageZip(buffer);const zip=await JSZip.loadAsync(buffer);clearImagePackage();let total=0;\r\n  for(const file of Object.values(zip.files)){\r\n    if(file.dir||!imagePackagePath(file.name)||!imagePackagePath(file.unsafeOriginalName||file.name))continue;\r\n    const size=Number(file._data?.uncompressedSize);if(!Number.isFinite(size)||size&lt;1||size&gt;40*MB||(total+=size)&gt;64*MB||imagePackageState.entries.length&gt;=40){clearImagePackage();throw Error(&#039;\u56fe\u7247\u5305\u5c55\u5f00\u5927\u5c0f\u8d85\u8fc7\u4e0a\u9650\u3002&#039;);}\r\n    imagePackageState.entries.push({file,name:file.name,size,blob:null});\r\n  }\r\n  if(!imagePackageState.entries.length)throw Error(&#039;\u6ca1\u6709\u53ef\u9009\u7684\u539f\u56fe\u6587\u4ef6\u3002&#039;);\r\n  imagePackageState.item=item;imagePackageState.licenseKey=licenseKey;imagePackageState.scope=creativeBoot.fontScope;\r\n  $(&#039;imagePackageTitle&#039;).textContent=String(item.title||&#039;\u672c\u7ad9\u56fe\u7247\u5305&#039;).slice(0,80);const list=$(&#039;imagePackageList&#039;);\r\n  imagePackageState.entries.forEach((entry,index)=&gt;{\r\n    const row=document.createElement(&#039;div&#039;);row.className=&#039;siw-package-item&#039;;const check=document.createElement(&#039;input&#039;);check.type=&#039;checkbox&#039;;check.id=&#039;package-image-&#039;+index;check.value=String(index);check.addEventListener(&#039;change&#039;,updatePackageSelection);\r\n    const label=document.createElement(&#039;label&#039;);label.htmlFor=check.id;label.textContent=entry.name;const info=document.createElement(&#039;small&#039;);info.textContent=(entry.size\/MB).toFixed(2)+&#039; MB&#039;;label.append(info);\r\n    const preview=document.createElement(&#039;button&#039;);preview.type=&#039;button&#039;;preview.textContent=&#039;\u9884\u89c8&#039;;preview.addEventListener(&#039;click&#039;,async()=&gt;{if(imagePackageState.busy)return;imagePackageState.busy=true;preview.disabled=true;try{const image=await packageEntryBlob(entry),loaded=await C.loadFile(new File([image],entry.name,{type:image.type}));const canvas=loaded.canvas||loaded;const box=$(&#039;assetPreviewContent&#039;);box.replaceChildren();const view=document.createElement(&#039;canvas&#039;);view.className=&#039;asset-preview-canvas&#039;;const ratio=Math.min(1,1000\/canvas.width,800\/canvas.height);view.width=Math.max(1,Math.round(canvas.width*ratio));view.height=Math.max(1,Math.round(canvas.height*ratio));view.getContext(&#039;2d&#039;).drawImage(canvas,0,0,view.width,view.height);C.release(canvas);box.append(view);$(&#039;assetPreviewTitle&#039;).textContent=entry.name;$(&#039;assetPreviewHint&#039;).textContent=&#039;\u6388\u6743\u539f\u56fe\u9884\u89c8\uff0c\u52fe\u9009\u540e\u53ef\u63d2\u5165\u5f53\u524d\u4f5c\u54c1\u3002&#039;;$(&#039;assetPreviewDialog&#039;).showModal();}catch(error){$(&#039;imagePackageStatus&#039;).textContent=error.message;}finally{imagePackageState.busy=false;preview.disabled=false;updatePackageSelection();}});\r\n    row.append(check,label,preview);list.append(row);\r\n  });\r\n  updatePackageSelection();$(&#039;imagePackageDialog&#039;).showModal();\r\n}\r\nasync function packageEntryBlob(entry){\r\n  if(!entry.blob)entry.blob=await boundedPackageFile(entry.file,Math.min(entry.size,40*MB));\r\n  return entry.blob;\r\n}\r\nfunction updatePackageSelection(){const count=$(&#039;imagePackageList&#039;).querySelectorAll(&#039;input:checked&#039;).length;$(&#039;imagePackageInsert&#039;).disabled=imagePackageState.busy||count===0||count&gt;20;$(&#039;imagePackageInsert&#039;).textContent=count?&#039;\u63d2\u5165\u6240\u9009 &#039;+count+&#039; \u5f20&#039;:&#039;\u63d2\u5165\u6240\u9009\u56fe\u7247&#039;;$(&#039;imagePackageStatus&#039;).textContent=&#039;\u5171 &#039;+imagePackageState.entries.length+&#039; \u5f20\u539f\u56fe \u00b7 \u5df2\u9009 &#039;+count+&#039; \u5f20\uff08\u5355\u6b21\u6700\u591a20\u5f20\uff09&#039;;}\r\nasync function insertPackageSelection(){\r\n  if(imagePackageState.busy)return;const selected=[...$(&#039;imagePackageList&#039;).querySelectorAll(&#039;input:checked&#039;)].map(input=&gt;imagePackageState.entries[Number(input.value)]).filter(Boolean);if(!selected.length||selected.length&gt;20)return;\r\n  imagePackageState.busy=true;$(&#039;imagePackageInsert&#039;).disabled=true;$(&#039;imagePackageStatus&#039;).textContent=&#039;\u6b63\u5728\u8bfb\u53d6\u6240\u9009\u539f\u56fe\u2026&#039;;\r\n  try{\r\n    if(!await requireAccess(&#039;siteAssets&#039;)||imagePackageState.scope!==creativeBoot.fontScope)throw Error(&#039;\u8d26\u6237\u5df2\u53d8\u5316\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u7d20\u6750\u3002&#039;);\r\n    const files=[];for(const entry of selected){const blob=await packageEntryBlob(entry);files.push(new File([blob],entry.name.replace(\/^.*[\\\\\/]\/,&#039;&#039;),{type:blob.type}));}\r\n    const before=new Set(scene.layers.map(layer=&gt;layer.id));await importFiles(files);\r\n    if(!scene.layers.some(layer=&gt;!before.has(layer.id)))throw Error(&#039;\u5c1a\u672a\u63d2\u5165\u6240\u9009\u56fe\u7247\u3002\u8bf7\u67e5\u770b\u753b\u5e03\u63d0\u793a\uff0c\u786e\u8ba4\u56fe\u5c42\u548c\u50cf\u7d20\u5bb9\u91cf\u3002&#039;);\r\n    rememberSiteMaterial(imagePackageState.item,imagePackageState.licenseKey);$(&#039;assetStatus&#039;).textContent=&#039;\u5df2\u4ece\u6388\u6743\u8d44\u6599\u5305\u63d2\u5165 &#039;+files.length+&#039; \u5f20\u539f\u56fe\u3002&#039;;imagePackageState.busy=false;$(&#039;imagePackageDialog&#039;).close();\r\n  }catch(error){$(&#039;imagePackageStatus&#039;).textContent=error.message;}\r\n  finally{imagePackageState.busy=false;$(&#039;imagePackageInsert&#039;).disabled=false;}\r\n}\r\n\r\nasync function fontPackage(item,licenseKey){\r\n  if(!await requireAccess(&#039;siteAssets&#039;))throw Error(&#039;\u767b\u5f55\u540e\u53ef\u4f7f\u7528\u514d\u8d39\u6216\u5df2\u8d2d\u7684\u672c\u7ad9\u5b57\u4f53\uff0c\u65e0\u9700\u989d\u5916\u5f00\u901a\u521b\u4f5c\u4f1a\u5458\u3002&#039;);\r\n  const cacheKey=creativeBoot.fontScope+&#039;:&#039;+Number(item.productId)+&#039;:&#039;+licenseKey;if(siteFontPackages.has(cacheKey))return siteFontPackages.get(cacheKey);\r\n  const asset=await requestHostOperation(&#039;font-fetch&#039;,{productId:Number(item.productId),licenseKey});\r\n  if(!(asset.blob instanceof Blob))throw Error(&#039;\u672a\u6536\u5230\u6709\u6548\u5b57\u4f53\u6587\u4ef6\u3002&#039;);\r\n  const entries=await parseFontPackage(asset.blob,asset.filename||item.title||&#039;\u672c\u7ad9\u5b57\u4f53&#039;);\r\n  const result={entries,productId:Number(item.productId),licenseKey,title:String(item.title||asset.title||&#039;\u672c\u7ad9\u5b57\u4f53&#039;)};\r\n  siteFontPackages.set(cacheKey,result);while(siteFontPackages.size&gt;4)siteFontPackages.delete(siteFontPackages.keys().next().value);return result;\r\n}\r\nasync function selectFontProduct(item,licenseKey){\r\n  const layer=active();if(!layer||layer.type!==&#039;text&#039;)throw Error(&#039;\u8bf7\u5148\u6dfb\u52a0\u6216\u9009\u4e2d\u4e00\u4e2a\u6587\u5b57\u56fe\u5c42\uff0c\u518d\u9009\u62e9\u672c\u7ad9\u5b57\u4f53\u3002&#039;);\r\n  fontTaskBusy=true;refreshFontNotice();\r\n  try{const pack=await fontPackage(item,licenseKey);fontPanel.package=pack;fontPanel.product=item;const select=$(&#039;fontCandidates&#039;);select.replaceChildren();pack.entries.forEach((entry,index)=&gt;{const option=document.createElement(&#039;option&#039;);option.value=String(index);option.textContent=fontVariantLabel(entry);select.append(option);});$(&#039;fontCandidateBox&#039;).hidden=false;renderFontVariants();$(&#039;fontStatus&#039;).textContent=&#039;\u5df2\u8bfb\u53d6 &#039;+pack.entries.length+&#039; \u4e2a\u5b57\u4f53\u6587\u4ef6\uff0c\u8bf7\u9009\u62e9\u9700\u8981\u7684\u5b57\u91cd\u6216\u6b3e\u5f0f\u3002&#039;;}\r\n  finally{fontTaskBusy=false;refreshFontNotice();}\r\n  if(fontPanel.package.entries.length===1)await applySiteFontCandidate();\r\n}\r\nasync function applySiteFontCandidate(){\r\n  if(fontTaskBusy)return;const layer=active(),pack=fontPanel.package;if(!layer||layer.type!==&#039;text&#039;){show(&#039;\u8bf7\u5148\u9009\u62e9\u6587\u5b57\u56fe\u5c42\u3002&#039;,true);return;}if(layer.locked){show(&#039;\u8be5\u6587\u5b57\u5df2\u9501\u5b9a\uff0c\u8bf7\u5148\u89e3\u9501\u3002&#039;,true);return;}const entry=pack?.entries[Number($(&#039;fontCandidates&#039;).value)];if(!entry)return;\r\n  fontTaskBusy=true;$(&#039;fontApply&#039;).disabled=true;refreshFontNotice();\r\n  try{\r\n    const loaded=await previewFontVariant(Number($(&#039;fontCandidates&#039;).value)),ref=normalizeSiteFontRef(loaded.ref);\r\n    if(!ref)throw Error(&#039;\u5b57\u4f53\u6807\u8bc6\u65e0\u6548\u3002&#039;);siteFontFaces.set(ref.family,loaded);\r\n    if(!scene.layers.includes(layer)||layer.locked)throw Error(&#039;\u539f\u6587\u5b57\u56fe\u5c42\u5df2\u88ab\u79fb\u9664\u6216\u9501\u5b9a\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u6587\u5b57\u3002&#039;);\r\n    pushHistory();layer.fontRef=ref;layer.fontFamily=ref.family;ensureSiteFontOption(ref);syncInspector();renderLayers();draw();$(&#039;fontStatus&#039;).textContent=&#039;\u5df2\u5e94\u7528\uff1a&#039;+ref.label+&#039;\u3002&#039;+(entry.metadataWarning?&#039; &#039;+entry.metadataWarning:&#039;&#039;);\r\n  }catch(error){$(&#039;fontStatus&#039;).textContent=error.message||&#039;\u5b57\u4f53\u52a0\u8f7d\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u5176\u4ed6\u5b57\u4f53\u3002&#039;;}\r\n  finally{fontTaskBusy=false;$(&#039;fontApply&#039;).disabled=false;refreshFontNotice();}\r\n}\r\nasync function restoreProjectFonts(){\r\n  if(fontTaskBusy)return;const missing=missingSiteFonts();if(!missing.length)return;\r\n  fontTaskBusy=true;refreshFontNotice();let restored=0;\r\n  try{\r\n    for(const ref of missing){\r\n      const pack=await fontPackage({productId:ref.productId,title:ref.label},ref.licenseKey),entry=pack.entries.find(e=&gt;e.fileName===ref.fileName);\r\n      if(!entry)throw Error(&#039;\u5b57\u4f53\u5305\u5df2\u53d8\u5316\uff0c\u627e\u4e0d\u5230 &#039;+ref.fileName+&#039;\u3002\u8bf7\u5728\u6587\u5b57\u9762\u677f\u91cd\u65b0\u9009\u62e9\u672c\u7ad9\u5b57\u4f53\u3002&#039;);\r\n      const loaded=await loadFontVariant(entry,ref.productId,ref.label,ref.licenseKey);\r\n      if(loaded.ref.hash!==ref.hash){document.fonts.delete(loaded.face);throw Error(&#039;\u5b57\u4f53\u6587\u4ef6\u5df2\u66f4\u65b0\uff1a&#039;+ref.label+&#039;\u3002\u8bf7\u91cd\u65b0\u9009\u62e9\u5b57\u4f53\u5e76\u68c0\u67e5\u6392\u7248\u540e\u518d\u5bfc\u51fa\u3002&#039;);}\r\n      siteFontFaces.set(ref.family,loaded);ensureSiteFontOption(ref);restored++;\r\n    }\r\n    syncInspector();draw();show(&#039;\u5df2\u6062\u590d &#039;+restored+&#039; \u6b3e\u672c\u7ad9\u5b57\u4f53\u3002&#039;);\r\n  }catch(error){show((restored?&#039;\u5df2\u6062\u590d &#039;+restored+&#039; \u6b3e\u3002&#039;:&#039;&#039;)+(error.message||&#039;\u5b57\u4f53\u6062\u590d\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\u3002&#039;),true);}\r\n  finally{fontTaskBusy=false;refreshFontNotice();}\r\n}\r\n\r\nfunction previewCut(piece){\r\n  const box=$(&#039;assetPreviewContent&#039;);box.replaceChildren();const canvas=document.createElement(&#039;canvas&#039;);canvas.className=&#039;asset-preview-canvas&#039;;const scale=Math.min(1,1200\/piece.width,1000\/piece.height);canvas.width=Math.max(1,Math.round(piece.width*scale));canvas.height=Math.max(1,Math.round(piece.height*scale));canvas.getContext(&#039;2d&#039;).drawImage(piece.canvas,0,0,canvas.width,canvas.height);box.append(canvas);$(&#039;assetPreviewTitle&#039;).textContent=piece.name.replace(\/\\.png$\/i,&#039;&#039;);$(&#039;assetPreviewHint&#039;).textContent=piece.width+&#039; \u00d7 &#039;+piece.height+&#039; px \u00b7 \u68cb\u76d8\u683c\u8868\u793a\u900f\u660e\u533a\u57df&#039;;$(&#039;assetPreviewDialog&#039;).showModal();\r\n}\r\nfunction previewCatalogItem(item){\r\n  const url=new URL(item.previewUrl,expectedHostOrigin);if(url.protocol!==&#039;https:&#039;||url.username||url.password)return;\r\n  const box=$(&#039;assetPreviewContent&#039;);box.replaceChildren();const img=document.createElement(&#039;img&#039;);img.className=&#039;asset-preview-canvas&#039;;img.src=url.href;img.alt=item.title;img.referrerPolicy=&#039;no-referrer&#039;;box.append(img);$(&#039;assetPreviewTitle&#039;).textContent=item.title;$(&#039;assetPreviewHint&#039;).textContent=&#039;\u5546\u54c1\u9884\u89c8\u3002\u63d2\u5165\u4f5c\u54c1\u65f6\u4ecd\u4f1a\u53d6\u5f97\u6240\u9009\u6388\u6743\u5bf9\u5e94\u7684\u539f\u6587\u4ef6\u3002&#039;;$(&#039;assetPreviewDialog&#039;).showModal();\r\n}\r\nfunction rememberSiteMaterial(item,licenseKey){recentSiteMaterials.delete(Number(item.productId));recentSiteMaterials.set(Number(item.productId),{item,licenseKey});while(recentSiteMaterials.size&gt;12)recentSiteMaterials.delete(recentSiteMaterials.keys().next().value);renderRecentMaterials();}\r\nfunction renderRecentMaterials(){const box=$(&#039;recentAssetGrid&#039;);box.replaceChildren();if(!recentSiteMaterials.size){libraryEmpty(box,&#039;\u672c\u6b21\u6253\u5f00\u5de5\u4f5c\u53f0\u540e\u4f7f\u7528\u7684\u672c\u7ad9\u7d20\u6750\u4f1a\u663e\u793a\u5728\u8fd9\u91cc\u3002&#039;);return;}[...recentSiteMaterials.values()].reverse().forEach(({item,licenseKey})=&gt;{const button=document.createElement(&#039;button&#039;);button.className=&#039;siw-library-card&#039;;button.title=&#039;\u518d\u6b21\u63d2\u5165 &#039;+item.title;const image=document.createElement(&#039;img&#039;);image.alt=&#039;&#039;;image.src=item.previewUrl;image.referrerPolicy=&#039;no-referrer&#039;;const title=document.createElement(&#039;span&#039;);title.textContent=item.title;button.append(image,title);button.addEventListener(&#039;click&#039;,async()=&gt;{if(materialPanel.busy)return;materialPanel.busy=true;button.disabled=true;try{await insertSiteMaterial(item,licenseKey);}catch(error){show(error.message,true);}finally{materialPanel.busy=false;button.disabled=false;}});box.append(button);});}\r\nfunction fontVariantLabel(entry){\r\n  const file=String(entry.fileName||&#039;&#039;).replace(\/^.*\\\/\/,&#039;&#039;).replace(\/\\.(ttf|otf|woff2?)$\/i,&#039;&#039;);\r\n  return entry.actualFamily&amp;&amp; !file.includes(entry.actualFamily)?entry.actualFamily+&#039; \u00b7 &#039;+file:file;\r\n}\r\nfunction renderFontVariants(){\r\n  const box=$(&#039;fontVariantGrid&#039;),pack=fontPanel.package;box.replaceChildren();if(!pack)return;\r\n  pack.entries.forEach((entry,index)=&gt;{const button=document.createElement(&#039;button&#039;);button.type=&#039;button&#039;;button.className=&#039;font-variant&#039;;button.dataset.fontVariant=String(index);button.setAttribute(&#039;aria-pressed&#039;,String(Number($(&#039;fontCandidates&#039;).value)===index));const label=document.createElement(&#039;small&#039;);label.textContent=fontVariantLabel(entry);const sample=document.createElement(&#039;span&#039;);sample.className=&#039;font-specimen&#039;;const loaded=loadedFontVariants.get(creativeBoot.fontScope+&#039;:&#039;+pack.productId+&#039;:&#039;+pack.licenseKey+&#039;:&#039;+entry.fileName);if(loaded){sample.style.fontFamily=&#039;&quot;&#039;+loaded.ref.family+&#039;&quot;&#039;;sample.textContent=(active()?.text||&#039;\u95ea\u5f97\u7d20\u6750 \u00b7 \u521b\u4f5c\u7075\u611f&#039;).slice(0,50);}else{sample.textContent=&#039;\u70b9\u51fb\u67e5\u770b\u5f53\u524d\u6587\u5b57\u6548\u679c&#039;;sample.style.fontSize=&#039;13px&#039;;}button.append(label,sample);button.addEventListener(&#039;click&#039;,async()=&gt;{if(fontTaskBusy)return;$(&#039;fontCandidates&#039;).value=String(index);fontTaskBusy=true;refreshFontNotice();try{await previewFontVariant(index);$(&#039;fontStatus&#039;).textContent=&#039;\u9884\u89c8\u5df2\u52a0\u8f7d\uff0c\u70b9\u51fb\u201c\u5e94\u7528\u6240\u9009\u5b57\u4f53\u201d\u4f7f\u7528\u3002&#039;;}catch(error){$(&#039;fontStatus&#039;).textContent=error.message;}finally{fontTaskBusy=false;refreshFontNotice();renderFontVariants();}});box.append(button);});\r\n}\r\nasync function previewFontVariant(index){\r\n  const pack=fontPanel.package,entry=pack?.entries[index];if(!entry)throw Error(&#039;\u8bf7\u9009\u62e9\u5b57\u4f53\u6b3e\u5f0f\u3002&#039;);const key=creativeBoot.fontScope+&#039;:&#039;+pack.productId+&#039;:&#039;+pack.licenseKey+&#039;:&#039;+entry.fileName;\r\n  if(loadedFontVariants.has(key))return loadedFontVariants.get(key);\r\n  const loaded=await loadFontVariant(entry,pack.productId,pack.title,pack.licenseKey);loadedFontVariants.set(key,loaded);return loaded;\r\n}\r\non(&#039;assetPreviewClose&#039;,()=&gt;$(&#039;assetPreviewDialog&#039;).close());\r\n$(&#039;fontCandidates&#039;).addEventListener(&#039;change&#039;,renderFontVariants);\r\ndocument.querySelectorAll(&#039;[data-asset-term]&#039;).forEach(button=&gt;button.addEventListener(&#039;click&#039;,()=&gt;{$(&#039;assetQuery&#039;).value=button.dataset.assetTerm;materialPanel.page=1;materialPanel.productId=0;loadSiteCatalog(&#039;image&#039;);}));\r\n$(&#039;recentAssetsDetails&#039;).addEventListener(&#039;toggle&#039;,renderRecentMaterials);\r\n$(&#039;stageWrap&#039;).addEventListener(&#039;dragover&#039;,event=&gt;{if(Array.from(event.dataTransfer?.types||[]).includes(&#039;application\/x-shande-material&#039;)){event.preventDefault();event.stopImmediatePropagation();event.dataTransfer.dropEffect=&#039;copy&#039;;}},true);\r\n$(&#039;stageWrap&#039;).addEventListener(&#039;drop&#039;,async event=&gt;{const raw=event.dataTransfer?.getData(&#039;application\/x-shande-material&#039;);if(!raw)return;event.preventDefault();event.stopImmediatePropagation();if(materialPanel.busy||busy)return;try{const data=JSON.parse(raw),item=materialPanel.items.find(i=&gt;i.productId===Number(data.productId))||recentSiteMaterials.get(Number(data.productId))?.item;if(!item||!item.canUse||!item.licenseOptions.some(v=&gt;v.key===data.licenseKey))throw Error(&#039;\u8bf7\u91cd\u65b0\u9009\u62e9\u6709\u6548\u7d20\u6750\u6388\u6743\u3002&#039;);materialPanel.busy=true;await insertSiteMaterial(item,data.licenseKey);}catch(error){show(error.message,true);}finally{materialPanel.busy=false;}},true);\r\n\r\nconst catalogReceiveBoot=receiveCreativeBoot;\r\nreceiveCreativeBoot=function(value){const previousScope=creativeBoot.fontScope;catalogReceiveBoot(value);if(previousScope&amp;&amp;previousScope!==creativeBoot.fontScope){for(const loaded of loadedFontVariants.values())document.fonts?.delete(loaded.face);for(const loaded of siteFontFaces.values())document.fonts?.delete(loaded.face);loadedFontVariants.clear();siteFontFaces.clear();siteFontPackages.clear();recentSiteMaterials.clear();materialPanel.items=[];materialPanel.loaded=false;fontPanel.items=[];fontPanel.loaded=false;fontPanel.package=null;fontPanel.product=null;$(&#039;fontCandidateBox&#039;).hidden=true;renderRecentMaterials();refreshFontNotice();}applyInitialCatalogAsset(value?.initialAsset);};\r\n$(&#039;textControls&#039;).insertAdjacentElement(&#039;afterend&#039;,$(&#039;siteFontsDetails&#039;));\r\nconst originalSiteSetMode=setMode;\r\nsetMode=function(value){\r\n  originalSiteSetMode(value);$(&#039;assetsPanel&#039;).hidden=value!==&#039;assets&#039;;$(&#039;siteFontsDetails&#039;).hidden=value!==&#039;text&#039;;\r\n  if(value===&#039;assets&#039;){$(&#039;modeTitle&#039;).textContent=&#039;\u672c\u7ad9\u7d20\u6750&#039;;$(&#039;propertyTitle&#039;).textContent=&#039;\u672c\u7ad9\u7d20\u6750&#039;;$(&#039;toolHint&#039;).textContent=&#039;\u641c\u7d22\u672c\u7ad9\u56fe\u7247\u3001\u56fe\u6848\u6216\u88c5\u9970\u5143\u7d20\uff0c\u9009\u62e9\u6388\u6743\u540e\u76f4\u63a5\u63d2\u5165\u5f53\u524d\u753b\u5e03\u3002&#039;;if(!materialPanel.loaded)loadSiteCatalog(&#039;image&#039;);}\r\n};\r\nconst originalSiteSync=syncInspector;\r\nsyncInspector=function(){scene.layers.filter(l=&gt;l.type===&#039;text&#039;&amp;&amp;l.fontRef).forEach(l=&gt;ensureSiteFontOption(l.fontRef));originalSiteSync();refreshFontNotice();};\r\nconst originalSiteDraw=draw;\r\ndraw=function(){originalSiteDraw();refreshFontNotice();};\r\nconst originalSiteLoadProject=loadProject;\r\nloadProject=async function(file,restoringDraft=false){const result=await originalSiteLoadProject(file,restoringDraft);refreshFontNotice();return result;};\r\nconst originalSiteExport=exportOne;\r\nexportOne=async function(layerOnly){if(fontTaskBusy||missingSiteFonts(layerOnly).length){show(&#039;\u8bf7\u5148\u6062\u590d\u6216\u5b8c\u6210\u52a0\u8f7d\u672c\u7ad9\u5b57\u4f53\uff0c\u518d\u5bfc\u51fa\uff1b\u5f53\u524d\u4e34\u65f6\u66ff\u4ee3\u5b57\u4f53\u4e0d\u4f1a\u88ab\u5bfc\u51fa\u3002&#039;,true);refreshFontNotice();return;}return originalSiteExport(layerOnly);};\r\n$(&#039;assetSearchForm&#039;).addEventListener(&#039;submit&#039;,event=&gt;{event.preventDefault();materialPanel.page=1;materialPanel.productId=0;loadSiteCatalog(&#039;image&#039;);});\r\n[&#039;assetScope&#039;,&#039;assetCategory&#039;].forEach(id=&gt;$(id).addEventListener(&#039;change&#039;,()=&gt;{materialPanel.page=1;materialPanel.productId=0;loadSiteCatalog(&#039;image&#039;);}));\r\non(&#039;assetClearLocation&#039;,()=&gt;{materialPanel.productId=0;materialPanel.page=1;loadSiteCatalog(&#039;image&#039;);});on(&#039;fontClearLocation&#039;,()=&gt;{fontPanel.productId=0;fontPanel.page=1;loadSiteCatalog(&#039;font&#039;);});\r\non(&#039;assetRefresh&#039;,()=&gt;loadSiteCatalog(&#039;image&#039;));on(&#039;fontRefresh&#039;,()=&gt;loadSiteCatalog(&#039;font&#039;));\r\ndocument.addEventListener(&#039;visibilitychange&#039;,()=&gt;{if(document.visibilityState===&#039;visible&#039;)refreshVisibleCatalog();});\r\nwindow.addEventListener(&#039;focus&#039;,refreshVisibleCatalog);\r\non(&#039;imagePackageClose&#039;,()=&gt;closeImagePackage());on(&#039;imagePackageCancel&#039;,()=&gt;closeImagePackage());\r\n$(&#039;imagePackageDialog&#039;).addEventListener(&#039;cancel&#039;,event=&gt;{if(imagePackageState.busy)event.preventDefault();});\r\n$(&#039;imagePackageDialog&#039;).addEventListener(&#039;close&#039;,clearImagePackage);\r\non(&#039;imagePackageInsert&#039;,insertPackageSelection);\r\n$(&#039;fontSearchForm&#039;).addEventListener(&#039;submit&#039;,event=&gt;{event.preventDefault();fontPanel.page=1;fontPanel.productId=0;loadSiteCatalog(&#039;font&#039;);});\r\n$(&#039;siteFontsDetails&#039;).addEventListener(&#039;toggle&#039;,()=&gt;{if($(&#039;siteFontsDetails&#039;).open&amp;&amp;!fontPanel.loaded)loadSiteCatalog(&#039;font&#039;);});\r\nfor(const [prefix,state,kind] of [[&#039;asset&#039;,materialPanel,&#039;image&#039;],[&#039;font&#039;,fontPanel,&#039;font&#039;]]){\r\n  on(prefix+&#039;Prev&#039;,()=&gt;{if(!state.busy&amp;&amp;state.page&gt;1){state.page--;loadSiteCatalog(kind);}});on(prefix+&#039;Next&#039;,()=&gt;{if(!state.busy&amp;&amp;state.hasMore){state.page++;loadSiteCatalog(kind);}});\r\n}\r\non(&#039;fontApply&#039;,applySiteFontCandidate);on(&#039;restoreSiteFonts&#039;,restoreProjectFonts);\r\n\/\/ fontFamily and fontRef are updated atomically by the native text control handler above.\r\n\r\n\/\/ BEGIN SHANDE_CANVAS_INTERACTION_V3\r\n\/\/ Keep selected as the primary ID for existing image tools; this set is editor-only.\r\nlet selectedIds=new Set(),canvasDrag=null,snapGuides=[],canvasGroupSerial=0,canvasTextEditor=null,textEditSession=null,canvasLayerDragIds=[];\r\nfunction normalizeCanvasSelection(force=false){\r\n  const ids=new Set(scene.layers.map(l=&gt;l.id));\r\n  if(force||!ids.has(selected)||!selectedIds.has(selected)){const primary=scene.layers.find(l=&gt;l.id===selected);selectedIds=new Set(primary?canvasGroupMembers(primary).map(l=&gt;l.id):[]);}\r\n  else selectedIds=new Set([...selectedIds].filter(id=&gt;ids.has(id)));\r\n  if(!selectedIds.size)selected=null;\r\n  return scene.layers.filter(l=&gt;selectedIds.has(l.id));\r\n}\r\nfunction selectedCanvasLayers(){return normalizeCanvasSelection();}\r\nfunction canvasCanChange(l){return !!l&amp;&amp;!l.locked&amp;&amp;!busy;}\r\nfunction canvasSelectedEditable(){const list=selectedCanvasLayers();return list.length&amp;&amp;list.every(l=&gt;!l.locked)?list:[];}\r\nfunction canvasGroupMembers(l){return l?.groupId?scene.layers.filter(x=&gt;x.groupId===l.groupId):l?[l]:[];}\r\nfunction setCanvasSelection(ids,primary,context=true){\r\n  finishCanvasTextEditing();textEditSession=null;\r\n  selectedIds=new Set(ids.filter(id=&gt;scene.layers.some(l=&gt;l.id===id)));selected=selectedIds.has(primary)?primary:[...selectedIds].at(-1)||null;\r\n  selection=null;lastSelectionQueued=false;lastQueuedCutId=null;resetAdjust(false);\r\n  if(context&amp;&amp;active()&amp;&amp;workspaceMode!==&#039;selection&#039;)setMode(active().type===&#039;text&#039;?&#039;text&#039;:active().type===&#039;shape&#039;?&#039;shape&#039;:&#039;edit&#039;);\r\n  renderLayers();syncInspector();draw();\r\n}\r\nfunction selectCanvasLayer(l,event={}){\r\n  if(!l)return;normalizeCanvasSelection();const group=event.altKey?[l]:canvasGroupMembers(l),ids=group.map(x=&gt;x.id);\r\n  if(event.shiftKey||event.ctrlKey||event.metaKey){const next=new Set(selectedIds),remove=ids.every(id=&gt;next.has(id));ids.forEach(id=&gt;remove?next.delete(id):next.add(id));setCanvasSelection([...next],l.id);}\r\n  else setCanvasSelection(ids,l.id);\r\n}\r\nfunction canvasRotatePoint(p,center,degrees){const r=degrees*Math.PI\/180,c=Math.cos(r),s=Math.sin(r),x=p.x-center.x,y=p.y-center.y;return{x:center.x+x*c-y*s,y:center.y+x*s+y*c};}\r\nfunction canvasLayerCorners(l){const c={x:l.x+l.width\/2,y:l.y+l.height\/2};return[[l.x,l.y],[l.x+l.width,l.y],[l.x+l.width,l.y+l.height],[l.x,l.y+l.height]].map(([x,y])=&gt;canvasRotatePoint({x,y},c,l.rotation||0));}\r\nfunction canvasBounds(list){const points=list.flatMap(canvasLayerCorners);if(!points.length)return null;const xs=points.map(p=&gt;p.x),ys=points.map(p=&gt;p.y),x=Math.min(...xs),y=Math.min(...ys),right=Math.max(...xs),bottom=Math.max(...ys);return{x,y,width:right-x,height:bottom-y,right,bottom,cx:(x+right)\/2,cy:(y+bottom)\/2};}\r\nfunction canvasSelectionBox(){const list=selectedCanvasLayers();if(!list.length)return null;if(list.length===1){const l=list[0];return{x:l.x,y:l.y,width:l.width,height:l.height,cx:l.x+l.width\/2,cy:l.y+l.height\/2,rotation:l.rotation||0};}return{...canvasBounds(list),rotation:0};}\r\nfunction canvasScreenUnit(){const rect=$(&#039;stage&#039;).getBoundingClientRect();return selectionViewport().width\/Math.max(1,rect.width);}\r\nfunction canvasBoxPoint(box,x,y){return canvasRotatePoint({x:box.x+x*box.width,y:box.y+y*box.height},{x:box.cx,y:box.cy},box.rotation);}\r\nfunction canvasTransformHandles(box){const corners=[[0,0],[1,0],[1,1],[0,1]].map(([x,y],i)=&gt;({...canvasBoxPoint(box,x,y),kind:&#039;resize&#039;,index:i,sx:x?1:-1,sy:y?1:-1}));const top=canvasBoxPoint(box,.5,0),c={x:box.cx,y:box.cy},offset=28*canvasScreenUnit();let rotate=canvasRotatePoint({x:box.cx,y:box.y-offset},c,box.rotation);if(rotate.x&lt;0||rotate.y&lt;0||rotate.x&gt;scene.width||rotate.y&gt;scene.height)rotate=canvasRotatePoint({x:box.cx,y:box.y+Math.min(box.height\/2,offset)},c,box.rotation);return{corners,top,rotate:{...rotate,kind:&#039;rotate&#039;}};}\r\nfunction canvasHitHandle(p){const list=canvasSelectedEditable(),box=canvasSelectionBox();if(!list.length||!box)return null;const h=canvasTransformHandles(box),radius=11*canvasScreenUnit();return[h.rotate,...h.corners].find(q=&gt;Math.hypot(q.x-p.x,q.y-p.y)&lt;=radius)||null;}\r\nfunction canvasDrawPolygon(ctx,points){ctx.beginPath();points.forEach((p,i)=&gt;i?ctx.lineTo(p.x,p.y):ctx.moveTo(p.x,p.y));ctx.closePath();ctx.stroke();}\r\nfunction drawInteractionOverlay(ctx){\r\n  if(comparingOriginal)return;\r\n  ctx.save();ctx.scale(previewScale,previewScale);const u=canvasScreenUnit();ctx.lineWidth=1.5*u;\r\n  if(tool===&#039;move&#039;){\r\n    const list=selectedCanvasLayers(),box=canvasSelectionBox();ctx.strokeStyle=list.some(l=&gt;l.locked)?&#039;#8893a3&#039;:&#039;#2468eb&#039;;ctx.fillStyle=&#039;#fff&#039;;\r\n    if(list.length&gt;1){ctx.setLineDash([4*u,3*u]);list.forEach(l=&gt;canvasDrawPolygon(ctx,canvasLayerCorners(l)));ctx.setLineDash([]);}\r\n    if(box){canvasDrawPolygon(ctx,[[0,0],[1,0],[1,1],[0,1]].map(([x,y])=&gt;canvasBoxPoint(box,x,y)));if(list.every(l=&gt;!l.locked)){\r\n      const h=canvasTransformHandles(box);ctx.beginPath();ctx.moveTo(h.top.x,h.top.y);ctx.lineTo(h.rotate.x,h.rotate.y);ctx.stroke();\r\n      [...h.corners,h.rotate].forEach(p=&gt;{ctx.beginPath();if(p.kind===&#039;rotate&#039;)ctx.arc(p.x,p.y,5*u,0,Math.PI*2);else ctx.rect(p.x-4.5*u,p.y-4.5*u,9*u,9*u);ctx.fill();ctx.stroke();});\r\n    }}\r\n    if(canvasDrag?.kind===&#039;marquee&#039;){const b=canvasDrag.box;ctx.fillStyle=&#039;#2468eb15&#039;;ctx.strokeStyle=&#039;#2468eb&#039;;ctx.setLineDash([4*u,3*u]);ctx.fillRect(b.x,b.y,b.width,b.height);ctx.strokeRect(b.x,b.y,b.width,b.height);ctx.setLineDash([]);}\r\n    ctx.strokeStyle=&#039;#e65c9c&#039;;ctx.lineWidth=u;snapGuides.forEach(g=&gt;{ctx.beginPath();if(g.axis===&#039;x&#039;){ctx.moveTo(g.value,0);ctx.lineTo(g.value,scene.height);}else{ctx.moveTo(0,g.value);ctx.lineTo(scene.width,g.value);}ctx.stroke();});\r\n  }\r\n  ctx.restore();\r\n  if(typeof window.SDCanvasSelectionHooks?.draw===&#039;function&#039;)window.SDCanvasSelectionHooks.draw(ctx,{previewScale,canvasScreenUnit});\r\n  drawCanvasCropHandles(ctx);positionCanvasTextEditor();\r\n}\r\nfunction canvasStartTransform(kind,p,event,handle){\r\n  const list=canvasSelectedEditable();if(!list.length)return false;const box=canvasSelectionBox();\r\n  canvasDrag={kind,start:p,box:{...box},layers:list.map(l=&gt;({id:l.id,x:l.x,y:l.y,width:l.width,height:l.height,rotation:l.rotation||0,fontSize:l.fontSize})),handle,pointerId:event.pointerId,changed:false,dirtyBefore:dirty,revisionBefore:editRevision,historyBefore:history.slice(),futureBefore:future.slice()};\r\n  if(kind===&#039;rotate&#039;)canvasDrag.startAngle=Math.atan2(p.y-box.cy,p.x-box.cx);\r\n  $(&#039;stage&#039;).setPointerCapture(event.pointerId);event.preventDefault();return true;\r\n}\r\nfunction canvasInteractionStart(event){\r\n  if(comparingOriginal||busy||canvasDrag||drag||event.button&gt;0)return !!canvasDrag;\r\n  if(typeof window.SDCanvasSelectionHooks?.start===&#039;function&#039;&amp;&amp;window.SDCanvasSelectionHooks.start(event))return true;\r\n  if(startCanvasCropDrag(event))return true;\r\n  if(tool!==&#039;move&#039;)return false;\r\n  finishCanvasTextEditing();const p=stagePoint(event),handle=canvasHitHandle(p);\r\n  if(handle)return canvasStartTransform(handle.kind,p,event,handle);\r\n  const hit=hitLayer(p);\r\n  if(hit){\r\n    normalizeCanvasSelection();if(event.shiftKey||event.ctrlKey||event.metaKey){selectCanvasLayer(hit,event);event.preventDefault();return true;}\r\n    if(!selectedIds.has(hit.id))selectCanvasLayer(hit,event);\r\n    if(selectedCanvasLayers().some(l=&gt;l.locked)){show(&#039;\u8be5\u56fe\u5c42\u6216\u7ec4\u5408\u5df2\u9501\u5b9a\uff0c\u8bf7\u5728\u56fe\u5c42\u5217\u8868\u89e3\u9501\u540e\u7f16\u8f91\u3002&#039;);event.preventDefault();return true;}\r\n    canvasStartTransform(&#039;move&#039;,p,event);return true;\r\n  }\r\n  const base=event.shiftKey?[...selectedIds]:[];if(!event.shiftKey)setCanvasSelection([],null,false);\r\n  canvasDrag={kind:&#039;marquee&#039;,start:p,box:{x:p.x,y:p.y,width:0,height:0},base,pointerId:event.pointerId};$(&#039;stage&#039;).setPointerCapture(event.pointerId);event.preventDefault();draw();return true;\r\n}\r\nfunction canvasEnsureHistory(){if(!canvasDrag.changed){pushHistory();canvasDrag.changed=true;}else markChanged();}\r\nfunction canvasSnapMove(box,dx,dy,event){\r\n  snapGuides=[];if(event.altKey||!$(&#039;canvasSnap&#039;).checked)return{dx,dy};\r\n  const targets={x:[0,scene.width\/2,scene.width],y:[0,scene.height\/2,scene.height]},excluded=new Set(canvasDrag.layers.map(l=&gt;l.id));\r\n  scene.layers.filter(l=&gt;l.visible&amp;&amp;!excluded.has(l.id)).forEach(l=&gt;{const b=canvasBounds([l]);targets.x.push(b.x,b.cx,b.right);targets.y.push(b.y,b.cy,b.bottom);});\r\n  const moving=canvasBounds(canvasDrag.layers),tolerance=6*canvasScreenUnit();\r\n  for(const axis of [&#039;x&#039;,&#039;y&#039;]){const delta=axis===&#039;x&#039;?dx:dy,values=axis===&#039;x&#039;?[moving.x,moving.cx,moving.right]:[moving.y,moving.cy,moving.bottom];let best=null;\r\n    for(const v of values)for(const target of targets[axis]){const distance=target-v-delta;if(Math.abs(distance)&lt;=tolerance&amp;&amp;(!best||Math.abs(distance)&lt;Math.abs(best.distance)))best={distance,target};}\r\n    if(best){if(axis===&#039;x&#039;)dx+=best.distance;else dy+=best.distance;snapGuides.push({axis,value:best.target});}\r\n  }return{dx,dy};\r\n}\r\n\/\/ Pure geometry: the opposite corner stays fixed even for rotated objects.\r\nfunction canvasResizeGeometry(box,handle,p,uniform){\r\n  const anchor=canvasBoxPoint(box,handle.sx&gt;0?0:1,handle.sy&gt;0?0:1),r=-box.rotation*Math.PI\/180,dx=p.x-anchor.x,dy=p.y-anchor.y;\r\n  let w=Math.max(1,handle.sx*(dx*Math.cos(r)-dy*Math.sin(r))),h=Math.max(1,handle.sy*(dx*Math.sin(r)+dy*Math.cos(r)));\r\n  if(uniform){const ratio=Math.max(w\/box.width,h\/box.height);w=box.width*ratio;h=box.height*ratio;}\r\n  const cap=Math.min(1,16384\/w,16384\/h);w*=cap;h*=cap;\r\n  const center=canvasRotatePoint({x:anchor.x+handle.sx*w\/2,y:anchor.y+handle.sy*h\/2},anchor,box.rotation);\r\n  return{x:center.x-w\/2,y:center.y-h\/2,width:w,height:h,cx:center.x,cy:center.y,rotation:box.rotation};\r\n}\r\nfunction canvasInteractionMove(event){\r\n  if(typeof window.SDCanvasSelectionHooks?.move===&#039;function&#039;&amp;&amp;window.SDCanvasSelectionHooks.move(event))return true;\r\n  if(moveCanvasCropDrag(event))return true;\r\n  if(!canvasDrag){if(tool===&#039;move&#039;&amp;&amp;!drag){const p=stagePoint(event),h=canvasHitHandle(p),l=hitLayer(p);$(&#039;stage&#039;).style.cursor=h?(h.kind===&#039;rotate&#039;?&#039;grab&#039;:h.index%2?&#039;nesw-resize&#039;:&#039;nwse-resize&#039;):l?(l.locked?&#039;not-allowed&#039;:&#039;move&#039;):&#039;crosshair&#039;;}return false;}\r\n  if(canvasDrag.pointerId!==event.pointerId)return true;const p=stagePoint(event),d=canvasDrag;\r\n  if(d.kind===&#039;marquee&#039;){d.box={x:Math.min(p.x,d.start.x),y:Math.min(p.y,d.start.y),width:Math.abs(p.x-d.start.x),height:Math.abs(p.y-d.start.y)};draw();return true;}\r\n  if(!d.changed&amp;&amp;Math.hypot(p.x-d.start.x,p.y-d.start.y)&lt;1.5*canvasScreenUnit())return true;\r\n  canvasEnsureHistory();snapGuides=[];\r\n  if(d.kind===&#039;move&#039;){let dx=p.x-d.start.x,dy=p.y-d.start.y;if(event.shiftKey){if(Math.abs(dx)&gt;Math.abs(dy))dy=0;else dx=0;}({dx,dy}=canvasSnapMove(d.box,dx,dy,event));d.layers.forEach(before=&gt;{const l=scene.layers.find(v=&gt;v.id===before.id);if(l){l.x=before.x+dx;l.y=before.y+dy;}});}\r\n  else if(d.kind===&#039;rotate&#039;){let degrees=(Math.atan2(p.y-d.box.cy,p.x-d.box.cx)-d.startAngle)*180\/Math.PI;if(event.shiftKey)degrees=Math.round(degrees\/15)*15;d.layers.forEach(before=&gt;{const l=scene.layers.find(v=&gt;v.id===before.id),c=canvasRotatePoint({x:before.x+before.width\/2,y:before.y+before.height\/2},{x:d.box.cx,y:d.box.cy},degrees);if(l){l.x=c.x-before.width\/2;l.y=c.y-before.height\/2;l.rotation=((before.rotation+degrees+540)%360+360)%360-180;}});}\r\n  else if(d.kind===&#039;resize&#039;){\r\n    const uniform=d.layers.length&gt;1||$(&#039;keepRatio&#039;).checked||event.shiftKey||d.layers.some(l=&gt;l.fontSize),next=canvasResizeGeometry(d.box,d.handle,p,uniform),sx=next.width\/d.box.width,sy=next.height\/d.box.height;\r\n    d.layers.forEach(before=&gt;{const l=scene.layers.find(v=&gt;v.id===before.id);if(!l)return;if(d.layers.length===1){l.x=next.x;l.y=next.y;l.width=next.width;l.height=next.height;}else{l.x=next.x+(before.x-d.box.x)*sx;l.y=next.y+(before.y-d.box.y)*sy;l.width=before.width*sx;l.height=before.height*sy;}if(l.type===&#039;text&#039;)l.fontSize=Math.max(8,Math.min(500,before.fontSize*Math.min(sx,sy)));});\r\n  }\r\n  draw();event.preventDefault();return true;\r\n}\r\nfunction canvasInteractionEnd(event,cancel=false){\r\n  if(typeof window.SDCanvasSelectionHooks?.end===&#039;function&#039;&amp;&amp;window.SDCanvasSelectionHooks.end(event,cancel))return true;\r\n  if(endCanvasCropDrag(event,cancel))return true;\r\n  if(!canvasDrag)return false;if(event&amp;&amp;canvasDrag.pointerId!==event.pointerId)return true;const d=canvasDrag;canvasDrag=null;snapGuides=[];\r\n  try{$(&#039;stage&#039;).releasePointerCapture(d.pointerId);}catch(_){}\r\n  if(d.kind===&#039;marquee&#039;&amp;&amp;!cancel){const b=d.box,ids=new Set(d.base);if(b.width&gt;2*canvasScreenUnit()&amp;&amp;b.height&gt;2*canvasScreenUnit())scene.layers.filter(l=&gt;l.visible&amp;&amp;!l.locked).forEach(l=&gt;{const a=canvasBounds([l]);if(a.x&gt;=b.x&amp;&amp;a.y&gt;=b.y&amp;&amp;a.right&lt;=b.x+b.width&amp;&amp;a.bottom&lt;=b.y+b.height)canvasGroupMembers(l).forEach(member=&gt;ids.add(member.id));});setCanvasSelection([...ids],[...ids].at(-1),false);}\r\n  if(cancel&amp;&amp;d.changed){d.layers.forEach(before=&gt;{const l=scene.layers.find(v=&gt;v.id===before.id);if(l)Object.assign(l,before);});history=d.historyBefore;future=d.futureBefore;editRevision=d.revisionBefore;setDirty(d.dirtyBefore);setProjectStatus(dirty?&#039;\u6709\u672a\u4fdd\u5b58\u7684\u66f4\u6539&#039;:&#039;\u5df2\u53d6\u6d88\u53d8\u6362&#039;);}\r\n  renderLayers();syncInspector();draw();return true;\r\n}\r\nfunction canvasApplyOperation(operation){if(busy)return;finishCanvasTextEditing();const list=canvasSelectedEditable();if(!list.length){show(&#039;\u8bf7\u5148\u9009\u62e9\u672a\u9501\u5b9a\u7684\u56fe\u5c42\u3002&#039;,true);return;}pushHistory();operation(list);renderLayers();syncInspector();draw();}\r\nfunction canvasAlignment(action){canvasApplyOperation(list=&gt;{const units=[];const seen=new Set();list.forEach(l=&gt;{const key=l.groupId||l.id;if(!seen.has(key)){seen.add(key);units.push(list.filter(v=&gt;l.groupId?v.groupId===l.groupId:v.id===l.id));}});const all=canvasBounds(list),target=units.length===1?{x:0,y:0,right:scene.width,bottom:scene.height,cx:scene.width\/2,cy:scene.height\/2}:all;\r\n  if(action===&#039;distributeX&#039;||action===&#039;distributeY&#039;){if(units.length&lt;3){show(&#039;\u7b49\u8ddd\u5206\u5e03\u9700\u8981\u81f3\u5c113\u4e2a\u72ec\u7acb\u5bf9\u8c61\u6216\u7ec4\u5408\u3002&#039;);return;}const axis=action===&#039;distributeX&#039;?&#039;x&#039;:&#039;y&#039;,size=axis===&#039;x&#039;?&#039;width&#039;:&#039;height&#039;,end=axis===&#039;x&#039;?&#039;right&#039;:&#039;bottom&#039;,items=units.map(layers=&gt;({layers,b:canvasBounds(layers)})).sort((a,b)=&gt;a.b[axis]-b.b[axis]);const gap=(items.at(-1).b[end]-items[0].b[axis]-items.reduce((sum,item)=&gt;sum+item.b[size],0))\/(items.length-1);let at=items[0].b[axis];items.forEach(item=&gt;{const delta=at-item.b[axis];item.layers.forEach(l=&gt;l[axis]+=delta);at+=item.b[size]+gap;});return;}\r\n  units.forEach(layers=&gt;{const b=canvasBounds(layers);let dx=0,dy=0;if(action===&#039;left&#039;)dx=target.x-b.x;if(action===&#039;centerX&#039;)dx=target.cx-b.cx;if(action===&#039;right&#039;)dx=target.right-b.right;if(action===&#039;top&#039;)dy=target.y-b.y;if(action===&#039;centerY&#039;)dy=target.cy-b.cy;if(action===&#039;bottom&#039;)dy=target.bottom-b.bottom;if(action===&#039;center&#039;){dx=scene.width\/2-all.cx;dy=scene.height\/2-all.cy;}layers.forEach(l=&gt;{l.x+=dx;l.y+=dy;});});});}\r\nfunction canvasToggleLock(){if(busy)return;const list=selectedCanvasLayers();if(!list.length)return;finishCanvasTextEditing();pushHistory();const lock=list.some(l=&gt;!l.locked);list.forEach(l=&gt;l.locked=lock);renderLayers();syncInspector();draw();}\r\nfunction canvasGroup(ungroup=false){const list=canvasSelectedEditable();if(!list.length||!ungroup&amp;&amp;list.length&lt;2)return;canvasApplyOperation(layers=&gt;{const groups=new Set(layers.map(l=&gt;l.groupId).filter(Boolean));if(ungroup)scene.layers.filter(l=&gt;groups.has(l.groupId)).forEach(l=&gt;delete l.groupId);else{const id=&#039;g_&#039;+Date.now().toString(36)+&#039;_&#039;+(++canvasGroupSerial);layers.forEach(l=&gt;l.groupId=id);}});}\r\nfunction canvasDelete(){canvasApplyOperation(list=&gt;{const ids=new Set(list.map(l=&gt;l.id));scene.layers=scene.layers.filter(l=&gt;!ids.has(l.id));selected=null;selectedIds.clear();selection=null;resetAdjust(false);});}\r\nfunction canvasDuplicate(){const list=canvasSelectedEditable();if(!list.length)return;const images=list.filter(l=&gt;l.type===&#039;image&#039;);if(scene.layers.length+list.length&gt;50||scene.layers.filter(l=&gt;l.type===&#039;image&#039;).length+images.length&gt;MAX_IMAGES||pixelCount()+images.reduce((n,l)=&gt;n+l.image.width*l.image.height,0)&gt;MAX_ASSET_PIXELS){show(&#039;\u590d\u5236\u540e\u8d85\u51fa\u9879\u76ee\u56fe\u5c42\u6216\u56fe\u7247\u50cf\u7d20\u4e0a\u9650\uff0c\u8bf7\u51cf\u5c11\u9009\u62e9\u3002&#039;,true);return;}canvasApplyOperation(layers=&gt;{const groups=new Map(),copies=layers.map(l=&gt;{const next={...l,id:nextId++,name:l.name+&#039;-\u526f\u672c&#039;,x:l.x+20,y:l.y+20};if(l.groupId){if(!groups.has(l.groupId))groups.set(l.groupId,&#039;g_&#039;+Date.now().toString(36)+&#039;_&#039;+(++canvasGroupSerial));next.groupId=groups.get(l.groupId);}if(l.type===&#039;image&#039;){next.image=cloneCanvas(l.image);next.canvas=next.image;next.baseline=cloneCanvas(l.baseline);}return next;});scene.layers.push(...copies);selectedIds=new Set(copies.map(l=&gt;l.id));selected=copies.at(-1).id;});}\r\nfunction canvasOrder(direction){canvasApplyOperation(list=&gt;{const ids=new Set(list.map(l=&gt;l.id));if(direction===&#039;top&#039;||direction===&#039;bottom&#039;){const selectedLayers=scene.layers.filter(l=&gt;ids.has(l.id)),rest=scene.layers.filter(l=&gt;!ids.has(l.id));scene.layers=direction===&#039;top&#039;?[...rest,...selectedLayers]:[...selectedLayers,...rest];}else if(direction===&#039;up&#039;){for(let i=scene.layers.length-2;i&gt;=0;i--)if(ids.has(scene.layers[i].id)&amp;&amp;!ids.has(scene.layers[i+1].id))[scene.layers[i],scene.layers[i+1]]=[scene.layers[i+1],scene.layers[i]];}else{for(let i=1;i&lt;scene.layers.length;i++)if(ids.has(scene.layers[i].id)&amp;&amp;!ids.has(scene.layers[i-1].id))[scene.layers[i],scene.layers[i-1]]=[scene.layers[i-1],scene.layers[i]];}});}\r\nfunction syncCanvasInteractionControls(){\r\n  const list=selectedCanvasLayers(),locked=list.some(l=&gt;l.locked),multiple=list.length&gt;1,unitCount=new Set(list.map(l=&gt;l.groupId||l.id)).size;\r\n  $(&#039;canvasSelectionStatus&#039;).textContent=list.length?`\u5df2\u9009\u62e9 ${list.length} \u4e2a\u56fe\u5c42${locked?&#039; \u00b7 \u5305\u542b\u9501\u5b9a\u56fe\u5c42&#039;:&#039;&#039;}`:&#039;\u70b9\u51fb\u5bf9\u8c61\uff0c\u6216\u4ece\u7a7a\u767d\u5904\u62d6\u51fa\u9009\u6846&#039;;\r\n  $(&#039;groupSelection&#039;).disabled=list.length&lt;2||locked;$(&#039;ungroupSelection&#039;).disabled=!list.some(l=&gt;l.groupId)||locked;$(&#039;lockSelection&#039;).disabled=!list.length;$(&#039;lockSelection&#039;).textContent=list.length&amp;&amp;list.every(l=&gt;l.locked)?&#039;\u89e3\u9501&#039;:&#039;\u9501\u5b9a&#039;;\r\n  document.querySelectorAll(&#039;[data-canvas-align]&#039;).forEach(b=&gt;b.disabled=!list.length||locked||b.dataset.canvasAlign.startsWith(&#039;distribute&#039;)&amp;&amp;unitCount&lt;3);\r\n  [&#039;layerTop&#039;,&#039;layerBottom&#039;,&#039;duplicate&#039;,&#039;deleteLayer&#039;,&#039;layerUp&#039;,&#039;layerDown&#039;,&#039;centerLayer&#039;].forEach(id=&gt;$(id).disabled=!list.length||locked);\r\n  if(locked||multiple){[&#039;layerX&#039;,&#039;layerY&#039;,&#039;layerW&#039;,&#039;layerH&#039;,&#039;layerRotation&#039;,&#039;layerOpacity&#039;,&#039;strokeWidth&#039;,&#039;strokeColor&#039;,&#039;shadowBlur&#039;,&#039;shadowColor&#039;,&#039;shadowX&#039;,&#039;shadowY&#039;,&#039;textValue&#039;,&#039;textSize&#039;,&#039;textColor&#039;,&#039;textFont&#039;,&#039;textBold&#039;,&#039;textAlign&#039;,&#039;textLineHeight&#039;,&#039;shapeFill&#039;,&#039;shapeNoFill&#039;,&#039;fontApply&#039;,&#039;pixelW&#039;,&#039;pixelH&#039;,&#039;applyPixelResize&#039;,&#039;rotateLeft&#039;,&#039;rotateRight&#039;,&#039;flipX&#039;,&#039;flipY&#039;,&#039;trimTransparent&#039;,&#039;resetPixels&#039;,&#039;applyAdjust&#039;,&#039;applyCropInPanel&#039;,&#039;cropSelection&#039;,&#039;extractSelection&#039;].forEach(id=&gt;{if($(id))$(id).disabled=true;});}\r\n  else [&#039;textValue&#039;,&#039;textSize&#039;,&#039;textColor&#039;,&#039;textFont&#039;,&#039;textBold&#039;,&#039;textAlign&#039;,&#039;textLineHeight&#039;,&#039;shapeFill&#039;,&#039;shapeNoFill&#039;,&#039;fontApply&#039;,&#039;applyCropInPanel&#039;].forEach(id=&gt;{if($(id))$(id).disabled=!active();});\r\n}\r\nfunction canvasFitTextHeight(l){if(l?.type!==&#039;text&#039;)return;const ctx=$(&#039;stage&#039;).getContext(&#039;2d&#039;);ctx.save();ctx.font=`${l.fontWeight||&#039;normal&#039;} ${l.fontSize}px ${l.fontFamily||&#039;sans-serif&#039;}`;let count=0;String(l.text||&#039;&#039;).split(&#039;\\n&#039;).forEach(paragraph=&gt;{let line=&#039;&#039;;for(const c of Array.from(paragraph)){if(line&amp;&amp;ctx.measureText(line+c).width&gt;l.width){count++;line=c;}else line+=c;}count++;});ctx.restore();l.height=Math.max(l.fontSize*(l.lineHeight||1.3),count*l.fontSize*(l.lineHeight||1.3));}\r\nfunction canvasTextInput(event){const l=active();if(!canvasCanChange(l)||l.type!==&#039;text&#039;||selectedCanvasLayers().length!==1)return;if(!textEditSession||textEditSession.id!==l.id){pushHistory();textEditSession={id:l.id};}else markChanged();l.text=event.target.value.slice(0,5000);l.name=l.text.slice(0,16)||&#039;\u6587\u5b57&#039;;canvasFitTextHeight(l);if(event.target!==$(&#039;textValue&#039;))$(&#039;textValue&#039;).value=l.text;renderLayers();draw();}\r\nfunction canvasTextStyle(id){const l=active();if(!canvasCanChange(l)||l.type!==&#039;text&#039;)return;if(id===&#039;textFont&#039;&amp;&amp;![&#039;sans-serif&#039;,&#039;serif&#039;,&#039;monospace&#039;].includes($(&#039;textFont&#039;).value)&amp;&amp;!siteFontFaces.has($(&#039;textFont&#039;).value)){show(&#039;\u8bf7\u5148\u6062\u590d\u8fd9\u6b3e\u672c\u7ad9\u5b57\u4f53\uff0c\u518d\u5e94\u7528\u5230\u6587\u5b57\u3002&#039;,true);syncInspector();return;}textEditSession=null;pushHistory();l.fontSize=Math.max(8,Math.min(500,Number($(&#039;textSize&#039;).value)||48));l.color=$(&#039;textColor&#039;).value;l.fontFamily=$(&#039;textFont&#039;).value;if(id===&#039;textFont&#039;){const loaded=siteFontFaces.get(l.fontFamily);if(loaded)l.fontRef=normalizeSiteFontRef(loaded.ref);else delete l.fontRef;}l.fontWeight=$(&#039;textBold&#039;).checked?&#039;bold&#039;:&#039;normal&#039;;l.align=$(&#039;textAlign&#039;).value;l.lineHeight=Math.max(.8,Math.min(3,Number($(&#039;textLineHeight&#039;).value)||1.3));canvasFitTextHeight(l);renderLayers();draw();}\r\nfunction positionCanvasTextEditor(){if(!canvasTextEditor)return;const l=scene.layers.find(l=&gt;l.id===canvasTextEditor.layerId);if(!l)return finishCanvasTextEditing();const r=$(&#039;stage&#039;).getBoundingClientRect(),scale=r.width\/scene.width,node=canvasTextEditor.node;Object.assign(node.style,{left:(r.left+l.x*scale)+&#039;px&#039;,top:(r.top+l.y*scale)+&#039;px&#039;,width:Math.max(32,l.width*scale)+&#039;px&#039;,height:Math.max(32,l.height*scale+4)+&#039;px&#039;,fontSize:(l.fontSize*scale)+&#039;px&#039;,fontFamily:l.fontFamily,fontWeight:l.fontWeight,lineHeight:String(l.lineHeight||1.3),textAlign:l.align||&#039;left&#039;,color:l.color,transform:`rotate(${l.rotation||0}deg)`});}\r\nfunction beginCanvasTextEditing(l){if(!canvasCanChange(l)||l.type!==&#039;text&#039;){if(l?.locked)show(&#039;\u6587\u5b57\u5df2\u9501\u5b9a\uff0c\u8bf7\u5148\u89e3\u9501\u3002&#039;);return;}setCanvasSelection([l.id],l.id);const node=document.createElement(&#039;textarea&#039;);node.className=&#039;canvas-inline-text&#039;;node.setAttribute(&#039;aria-label&#039;,&#039;\u5728\u753b\u5e03\u4e0a\u7f16\u8f91\u6587\u5b57&#039;);node.setAttribute(&#039;maxlength&#039;,&#039;5000&#039;);node.spellcheck=false;node.value=l.text;document.body.append(node);canvasTextEditor={node,layerId:l.id};positionCanvasTextEditor();node.addEventListener(&#039;input&#039;,canvasTextInput);node.addEventListener(&#039;blur&#039;,()=&gt;finishCanvasTextEditing());node.addEventListener(&#039;keydown&#039;,e=&gt;{if(e.key===&#039;Escape&#039;||(e.ctrlKey||e.metaKey)&amp;&amp;e.key===&#039;Enter&#039;){e.preventDefault();finishCanvasTextEditing();}});node.focus();node.setSelectionRange(node.value.length,node.value.length);show(&#039;\u76f4\u63a5\u8f93\u5165\u6587\u5b57\uff1b\u70b9\u51fb\u5916\u90e8\u6216\u6309 Ctrl\/\u2318 + Enter \u5b8c\u6210\u3002&#039;);}\r\nfunction finishCanvasTextEditing(){if(!canvasTextEditor)return;const node=canvasTextEditor.node;canvasTextEditor=null;node.remove();textEditSession=null;}\r\nfunction canvasKeyboard(event){if(busy||[&#039;INPUT&#039;,&#039;TEXTAREA&#039;,&#039;SELECT&#039;].includes(document.activeElement.tagName)||document.activeElement.isContentEditable||document.querySelector(&#039;dialog[open]&#039;))return;const mod=event.ctrlKey||event.metaKey,key=event.key.toLowerCase();\r\n  if(event.key===&#039;Escape&#039;){event.preventDefault();if(canvasDrag)canvasInteractionEnd(null,true);else{setCanvasSelection([],null,false);closeProperties();}return;}\r\n  if(mod&amp;&amp;key===&#039;z&#039;){event.preventDefault();event.shiftKey?redo():undo();return;}\r\n  if(mod&amp;&amp;key===&#039;a&#039;){event.preventDefault();setCanvasSelection(scene.layers.filter(l=&gt;l.visible&amp;&amp;!l.locked).map(l=&gt;l.id),selected,false);return;}\r\n  if(mod&amp;&amp;key===&#039;d&#039;){event.preventDefault();canvasDuplicate();return;}\r\n  if(mod&amp;&amp;key===&#039;g&#039;){event.preventDefault();canvasGroup(event.shiftKey);return;}\r\n  if(mod&amp;&amp;event.shiftKey&amp;&amp;key===&#039;l&#039;){event.preventDefault();canvasToggleLock();return;}\r\n  if(mod&amp;&amp;(key===&#039;[&#039;||key===&#039;]&#039;)){event.preventDefault();canvasOrder(event.shiftKey?(key===&#039;]&#039;?&#039;top&#039;:&#039;bottom&#039;):(key===&#039;]&#039;?&#039;up&#039;:&#039;down&#039;));return;}\r\n  if(event.key===&#039;Delete&#039;||event.key===&#039;Backspace&#039;){event.preventDefault();canvasDelete();return;}\r\n  if(event.key===&#039;Enter&#039;&amp;&amp;active()?.type===&#039;text&#039;){event.preventDefault();beginCanvasTextEditing(active());return;}\r\n  const amount=event.shiftKey?10:1,delta={ArrowLeft:[-amount,0],ArrowRight:[amount,0],ArrowUp:[0,-amount],ArrowDown:[0,amount]}[event.key];if(delta){event.preventDefault();canvasApplyOperation(layers=&gt;layers.forEach(l=&gt;{l.x+=delta[0];l.y+=delta[1];}));}\r\n}\r\n\/\/ Crop hooks are separate from pixel application, so root can extend ratio\/feather policy.\r\nlet canvasCropDrag=null;\r\nfunction canvasCropAllowed(){return workspaceMode!==&#039;selection&#039;&amp;&amp;!busy&amp;&amp;!comparingOriginal&amp;&amp;tool===&#039;rect&#039;&amp;&amp;selection?.type===&#039;rect&#039;&amp;&amp;active()?.type===&#039;image&#039;&amp;&amp;!active().locked;}\r\nfunction canvasImageToStage(p,l){if(workspaceMode===&#039;selection&#039;)return p;const f=canvasSourceGeometry(l),center={x:l.x+l.width\/2,y:l.y+l.height\/2};return canvasRotatePoint({x:center.x+f.x+p.x*f.width\/l.image.width,y:center.y+f.y+p.y*f.height\/l.image.height},center,l.rotation||0);}\r\nfunction canvasCropRatio(){const value=$(&#039;cropRatio&#039;)?.value||&#039;free&#039;;if(value===&#039;free&#039;||value===&#039;custom&#039;)return 0;if(value===&#039;original&#039;)return active().image.width\/active().image.height;const pair=value.match(\/^(\\d+(?:\\.\\d+)?)[x:\\\/]([\\d.]+)$\/);const ratio=pair?Number(pair[1])\/Number(pair[2]):Number(value);return Number.isFinite(ratio)&amp;&amp;ratio&gt;0?ratio:0;}\r\nfunction drawCanvasCropHandles(ctx){if(!canvasCropAllowed())return;const l=active(),u=canvasScreenUnit();ctx.save();ctx.scale(previewScale,previewScale);ctx.strokeStyle=&#039;#2468eb&#039;;ctx.fillStyle=&#039;#fff&#039;;ctx.lineWidth=1.5*u;[[0,0],[1,0],[1,1],[0,1]].forEach(([x,y])=&gt;{const p=canvasImageToStage({x:selection.x+x*selection.width,y:selection.y+y*selection.height},l);ctx.fillRect(p.x-4*u,p.y-4*u,8*u,8*u);ctx.strokeRect(p.x-4*u,p.y-4*u,8*u,8*u);});ctx.restore();}\r\nfunction startCanvasCropDrag(event){if(!canvasCropAllowed())return false;const l=active(),p=stagePoint(event),q=boundedPoint(localPoint(p,l),l),corners=[[0,0],[1,0],[1,1],[0,1]],radius=11*canvasScreenUnit();let handle=corners.findIndex(([x,y])=&gt;{const s=canvasImageToStage({x:selection.x+x*selection.width,y:selection.y+y*selection.height},l);return Math.hypot(s.x-p.x,s.y-p.y)&lt;=radius;});const inside=q.x&gt;selection.x&amp;&amp;q.x&lt;selection.x+selection.width&amp;&amp;q.y&gt;selection.y&amp;&amp;q.y&lt;selection.y+selection.height;if(handle&lt;0&amp;&amp;!inside)return false;canvasCropDrag={start:q,before:{...selection},handle,pointerId:event.pointerId};$(&#039;stage&#039;).setPointerCapture(event.pointerId);event.preventDefault();return true;}\r\nfunction moveCanvasCropDrag(event){if(!canvasCropDrag)return false;if(canvasCropDrag.pointerId!==event.pointerId)return true;const d=canvasCropDrag,l=active(),q=boundedPoint(localPoint(stagePoint(event),l),l),b=d.before;if(d.handle&lt;0){selection.x=Math.max(0,Math.min(l.image.width-b.width,b.x+q.x-d.start.x));selection.y=Math.max(0,Math.min(l.image.height-b.height,b.y+q.y-d.start.y));}else{const [hx,hy]=[[0,0],[1,0],[1,1],[0,1]][d.handle],ax=b.x+(hx?0:b.width),ay=b.y+(hy?0:b.height),sx=hx?1:-1,sy=hy?1:-1;let w=Math.max(1,sx*(q.x-ax)),h=Math.max(1,sy*(q.y-ay));const ratio=event.shiftKey?1:canvasCropRatio();if(ratio){if(w\/h&gt;ratio)h=w\/ratio;else w=h*ratio;}const limit=Math.min(1,(sx&gt;0?l.image.width-ax:ax)\/w,(sy&gt;0?l.image.height-ay:ay)\/h);w*=limit;h*=limit;selection={type:&#039;rect&#039;,x:sx&gt;0?ax:ax-w,y:sy&gt;0?ay:ay-h,width:w,height:h};}lastSelectionQueued=false;draw();event.preventDefault();return true;}\r\nfunction endCanvasCropDrag(event,cancel=false){if(!canvasCropDrag)return false;if(event&amp;&amp;canvasCropDrag.pointerId!==event.pointerId)return true;const d=canvasCropDrag;canvasCropDrag=null;if(cancel)selection=d.before;try{$(&#039;stage&#039;).releasePointerCapture(d.pointerId);}catch(_){}syncInspector();draw();return true;}\r\n\/\/ END SHANDE_CANVAS_INTERACTION_V3\r\n\r\n\/\/ BEGIN SHANDE_VECTOR_TRACING_V1 - original integration, upstream license retained in worker bytes.\r\nconst vectorWorkerBase64=&#039;LyoKCWltYWdldHJhY2VyLmpzIHZlcnNpb24gMS4yLjYKCVNpbXBsZSByYXN0ZXIgaW1hZ2UgdHJhY2VyIGFuZCB2ZWN0b3JpemVyIHdyaXR0ZW4gaW4gSmF2YVNjcmlwdC4KCWFuZHJhc0BqYW5rb3ZpY3MubmV0CiovCgovKgoK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1hZ2V8c2NyaXB0fGZvcmVpZ25PYmplY3R8dXNlKVxifCg\/OmhyZWZ8b25sb2FkKVxzKj0vaS50ZXN0KGJvZHkpKXRocm93IEVycm9yKCfnn6Lph4\/nu5Pmnpzpqozor4HlpLHotKXjgIInKTsKICAgICAgY29uc3Qgc3ZnPSc8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9Iicrb3crJyIgaGVpZ2h0PSInK29oKyciIHZpZXdCb3g9IjAgMCAnK293KycgJytvaCsnIj48ZGVzYz5CYXNpYyBsb2NhbCBiaXRtYXAgdHJhY2luZy4gSW1hZ2VUcmFjZXJKUyAxLjIuNiAoVW5saWNlbnNlKSwgaW50ZWdyYXRlZCBieSB6aXBnZXQuY24uPC9kZXNjPjxnIHRyYW5zZm9ybT0ic2NhbGUoJysob3cvdykrJyAnKyhvaC9oKSsnKSI+Jytib2R5Kyc8L2c+PC9zdmc+JzsKICAgICAgaWYoc3ZnLmxlbmd0aD40MDAwMDAwKXRocm93IEVycm9yKCfnn6Lph4\/mlofku7bovoPlpKfvvIzor7flh4\/lsJHpopzoibLmiJbkvb\/nlKjnroDmtIHmqKHlvI\/jgIInKTsKICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7dHlwZToncmVzdWx0JyxzdmcscGF0aENvdW50LGNvbG9yczpwYWxldHRlLmZpbHRlcihwPT5wLmE+MCkubGVuZ3RoLHdpZHRoOncsaGVpZ2h0Omh9KTsKICAgIH1jYXRjaChlcnJvcil7c2VsZi5wb3N0TWVzc2FnZSh7dHlwZTonZXJyb3InLG1lc3NhZ2U6ZXJyb3I\/Lm1lc3NhZ2V8fCfmnKzmrKHmj4\/mkbnmnKrlrozmiJDvvIzor7fpmY3kvY7popzoibLmlbDph43or5XjgIInfSk7fQogIH07Cn0pKCk7Cg==&#039;;\r\nlet vectorJob=null,vectorResult=null,vectorPreviewUrls=[];\r\nfunction clearVectorResult(){vectorResult=null;$(&#039;vectorDownload&#039;).disabled=true;vectorPreviewUrls.forEach(url=&gt;URL.revokeObjectURL(url));vectorPreviewUrls=[];[&#039;vectorOriginalPreview&#039;,&#039;vectorResultPreview&#039;].forEach(id=&gt;{$(id).removeAttribute(&#039;src&#039;);$(id).hidden=true;});}\r\nfunction vectorStatus(message,error=false){$(&#039;vectorStatus&#039;).textContent=message;$(&#039;vectorStatus&#039;).classList.toggle(&#039;error&#039;,error);}\r\nfunction cancelVectorJob(){if(vectorJob)vectorJob.cancel();}\r\nfunction vectorInputChanged(){if(vectorJob)return;clearVectorResult();vectorStatus(&#039;\u8bbe\u7f6e\u5df2\u66f4\u65b0\uff0c\u70b9\u51fb\u201c\u751f\u6210\u9884\u89c8\u201d\u67e5\u770b\u65b0\u7684\u7ed3\u679c\u3002&#039;);}\r\nfunction openVectorDialog(){\r\n  if(busy){show(&#039;\u5f53\u524d\u64cd\u4f5c\u5c1a\u672a\u5b8c\u6210\uff0c\u8bf7\u7a0d\u540e\u518d\u6253\u5f00\u77e2\u91cf\u63cf\u6479\u3002&#039;,true);return;}\r\n  clearVectorResult();$(&#039;vectorSource&#039;).value=active()?.type===&#039;image&#039;?&#039;layer&#039;:&#039;scene&#039;;vectorStatus(&#039;\u9009\u62e9\u6765\u6e90\u4e0e\u989c\u8272\u6570\uff0c\u5148\u9884\u89c8\uff0c\u518d\u4e0b\u8f7d SVG\u3002&#039;);$(&#039;vectorDialog&#039;).showModal();\r\n}\r\nasync function createVectorInput(){\r\n  const kind=$(&#039;vectorSource&#039;).value,edge=$(&#039;vectorDetail&#039;).value===&#039;fine&#039;?512:384;\r\n  let canvas,name,originalWidth,originalHeight;\r\n  if(kind===&#039;layer&#039;){\r\n    const layer=imageLayer(),source=adjusted||layer.image;originalWidth=source.width;originalHeight=source.height;name=layer.name;\r\n    const ratio=Math.min(1,edge\/originalWidth,edge\/originalHeight);canvas=C.createCanvas(Math.max(1,Math.round(originalWidth*ratio)),Math.max(1,Math.round(originalHeight*ratio)));const ctx=canvas.getContext(&#039;2d&#039;);ctx.imageSmoothingEnabled=true;ctx.imageSmoothingQuality=&#039;high&#039;;ctx.drawImage(source,0,0,canvas.width,canvas.height);\r\n  }else{\r\n    if(!scene.layers.length)throw Error(&#039;\u8bf7\u5148\u6dfb\u52a0\u56fe\u7247\u3001\u6587\u5b57\u6216\u5f62\u72b6\u3002&#039;);\r\n    if(typeof fontTaskBusy!==&#039;undefined&#039;&amp;&amp;fontTaskBusy)throw Error(&#039;\u672c\u7ad9\u5b57\u4f53\u6b63\u5728\u52a0\u8f7d\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5\u3002&#039;);\r\n    if(typeof missingSiteFonts===&#039;function&#039;&amp;&amp;missingSiteFonts(false).length)throw Error(&#039;\u8bf7\u5148\u6062\u590d\u9879\u76ee\u5b57\u4f53\u6216\u91cd\u65b0\u9009\u62e9\u53ef\u7528\u5b57\u4f53\uff0c\u518d\u63cf\u6479\u753b\u5e03\u3002&#039;);\r\n    if(document.fonts){let fontTimer;try{await Promise.race([document.fonts.ready,new Promise((resolve,reject)=&gt;{fontTimer=setTimeout(()=&gt;reject(Error(&#039;\u5b57\u4f53\u4ecd\u5728\u52a0\u8f7d\uff0c\u8bf7\u7a0d\u540e\u91cd\u65b0\u751f\u6210\u9884\u89c8\u3002&#039;)),5000);})]);}finally{clearTimeout(fontTimer);}}\r\n    originalWidth=scene.width;originalHeight=scene.height;name=&#039;\u95ea\u5f97\u753b\u5e03&#039;;const ratio=Math.min(1,edge\/originalWidth,edge\/originalHeight);canvas=C.renderScene({...scene,layers:displayLayers(false)},{scale:ratio});\r\n  }\r\n  try{\r\n    if(canvas.width&gt;512||canvas.height&gt;512||canvas.width*canvas.height&gt;262144)throw Error(&#039;\u9884\u89c8\u5c3a\u5bf8\u8d85\u9650\uff0c\u8bf7\u5148\u7f29\u5c0f\u753b\u5e03\u3002&#039;);\r\n    const pixels=canvas.getContext(&#039;2d&#039;,{willReadFrequently:true}).getImageData(0,0,canvas.width,canvas.height);\r\n    const original=canvas.toDataURL(&#039;image\/png&#039;);\r\n    return {pixels:pixels.data.buffer,width:canvas.width,height:canvas.height,originalWidth,originalHeight,name,original};\r\n  }finally{C.release(canvas);}\r\n}\r\nfunction traceVectorInWorker(input){\r\n  return new Promise((resolve,reject)=&gt;{\r\n    if(typeof Worker===&#039;undefined&#039;){reject(Error(&#039;\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u540e\u53f0\u63cf\u6479\uff0c\u8bf7\u6362\u7528\u65b0\u7248\u6d4f\u89c8\u5668\u3002&#039;));return;}\r\n    let worker,url,timer,finished=false;\r\n    function finish(error,result){if(finished)return;finished=true;clearTimeout(timer);worker?.terminate();if(url)URL.revokeObjectURL(url);vectorJob=null;$(&#039;vectorCancel&#039;).hidden=true;error?reject(error):resolve(result);}\r\n    vectorJob={cancel:()=&gt;finish(Object.assign(Error(&#039;\u5df2\u53d6\u6d88\u63cf\u6479\uff0c\u539f\u56fe\u548c\u753b\u5e03\u6ca1\u6709\u6539\u53d8\u3002&#039;),{name:&#039;AbortError&#039;}))};\r\n    try{\r\n      const bytes=Uint8Array.from(atob(vectorWorkerBase64),ch=&gt;ch.charCodeAt(0));url=URL.createObjectURL(new Blob([bytes],{type:&#039;text\/javascript&#039;}));worker=new Worker(url);\r\n      worker.onmessage=event=&gt;{const data=event.data||{};if(data.type===&#039;status&#039;)vectorStatus(data.message);else if(data.type===&#039;result&#039;)finish(null,data);else if(data.type===&#039;error&#039;)finish(Error(data.message||&#039;\u63cf\u6479\u672a\u5b8c\u6210\u3002&#039;));};\r\n      worker.onerror=event=&gt;{event.preventDefault();finish(Error(&#039;\u540e\u53f0\u63cf\u6479\u65e0\u6cd5\u8fd0\u884c\uff0c\u8bf7\u5237\u65b0\u6216\u6362\u7528\u65b0\u7248\u6d4f\u89c8\u5668\u3002&#039;));};\r\n      timer=setTimeout(()=&gt;finish(Error(&#039;\u63cf\u6479\u8d85\u8fc712\u79d2\uff0c\u5df2\u505c\u6b62\u3002\u8bf7\u6539\u7528\u7b80\u6d01\u6a21\u5f0f\u6216\u51cf\u5c11\u989c\u8272\u3002&#039;)),12000);\r\n      $(&#039;vectorCancel&#039;).hidden=false;worker.postMessage({width:input.width,height:input.height,originalWidth:input.originalWidth,originalHeight:input.originalHeight,pixels:input.pixels,colors:Number($(&#039;vectorColors&#039;).value),detail:$(&#039;vectorDetail&#039;).value},[input.pixels]);\r\n    }catch(error){finish(Error(&#039;\u6d4f\u89c8\u5668\u672a\u80fd\u542f\u52a8\u540e\u53f0\u63cf\u6479\u3002\u8bf7\u5237\u65b0\u6216\u6362\u7528\u65b0\u7248\u6d4f\u89c8\u5668\u3002&#039;));}\r\n  });\r\n}\r\nasync function generateVectorPreview(){\r\n  if(busy||vectorJob)return;\r\n  clearVectorResult();$(&#039;vectorGenerate&#039;).disabled=true;[&#039;vectorSource&#039;,&#039;vectorColors&#039;,&#039;vectorDetail&#039;].forEach(id=&gt;$(id).disabled=true);vectorStatus(&#039;\u6b63\u5728\u51c6\u5907\u56fe\u7247\u2026&#039;);\r\n  await run(async()=&gt;{\r\n    try{\r\n      const input=await createVectorInput();if(!$(&#039;vectorDialog&#039;).open)throw Object.assign(Error(&#039;\u5df2\u53d6\u6d88\u63cf\u6479\u3002&#039;),{name:&#039;AbortError&#039;});\r\n      $(&#039;vectorOriginalPreview&#039;).src=input.original;$(&#039;vectorOriginalPreview&#039;).hidden=false;\r\n      const result=await traceVectorInWorker(input);if(!$(&#039;vectorDialog&#039;).open)return;\r\n      if(typeof result.svg!==&#039;string&#039;||!result.svg.includes(&#039;&lt;path &#039;)||result.svg.length&gt;4000000)throw Error(&#039;\u672a\u6536\u5230\u6709\u6548\u7684\u77e2\u91cf\u7ed3\u679c\u3002&#039;);\r\n      const blob=new Blob([result.svg],{type:&#039;image\/svg+xml&#039;}),url=URL.createObjectURL(blob);vectorPreviewUrls.push(url);$(&#039;vectorResultPreview&#039;).src=url;$(&#039;vectorResultPreview&#039;).hidden=false;\r\n      vectorResult={blob,name:C.filename(input.name+&#039;-\u77e2\u91cf\u63cf\u6479&#039;,&#039;svg&#039;)};$(&#039;vectorDownload&#039;).disabled=false;\r\n      vectorStatus(&#039;\u5df2\u751f\u6210 &#039;+result.pathCount+&#039; \u6761\u8f6e\u5ed3\uff0c\u7ea6 &#039;+Math.max(1,Math.round(blob.size\/1024))+&#039; KB\u3002\u5206\u6790\u5c3a\u5bf8 &#039;+result.width+&#039; \u00d7 &#039;+result.height+&#039;\uff0c\u8bf7\u68c0\u67e5\u7ec6\u8282\u540e\u4e0b\u8f7d\u3002&#039;);\r\n    }catch(error){vectorStatus(error.message||&#039;\u63cf\u6479\u672a\u5b8c\u6210\u3002&#039;,error.name!==&#039;AbortError&#039;);}\r\n    finally{$(&#039;vectorGenerate&#039;).disabled=false;[&#039;vectorSource&#039;,&#039;vectorColors&#039;,&#039;vectorDetail&#039;].forEach(id=&gt;$(id).disabled=false);}\r\n  });\r\n}\r\nasync function downloadVectorResult(){\r\n  if(!vectorResult||vectorJob)return;\r\n  const result=vectorResult;if(!await requireAccess(&#039;advancedExport&#039;)){vectorStatus(&#039;SVG \u5c5e\u4e8e\u4f1a\u5458\u9ad8\u7ea7\u5bfc\u51fa\uff1b\u53ef\u7ee7\u7eed\u9884\u89c8\uff0c\u5f53\u524d\u4f5c\u54c1\u4f1a\u4fdd\u7559\u3002&#039;);return;}\r\n  try{if(typeof hostDownloadConfirmed===&#039;function&#039;)await hostDownloadConfirmed(result.blob,result.name);else download(result.blob,result.name);vectorStatus(&#039;SVG \u6587\u4ef6\u5df2\u51c6\u5907\u597d\uff0c\u5305\u542b\u53ef\u7f29\u653e\u7684\u771f\u5b9e\u8def\u5f84\u3002&#039;);}catch(error){vectorStatus(error.message||&#039;\u4e0b\u8f7d\u672a\u5b8c\u6210\uff0c\u8bf7\u91cd\u8bd5\u3002&#039;,true);}\r\n}\r\non(&#039;vectorOpen&#039;,openVectorDialog);on(&#039;vectorGenerate&#039;,generateVectorPreview);on(&#039;vectorCancel&#039;,cancelVectorJob);on(&#039;vectorDownload&#039;,downloadVectorResult);on(&#039;vectorClose&#039;,()=&gt;$(&#039;vectorDialog&#039;).close());\r\n[&#039;vectorSource&#039;,&#039;vectorColors&#039;,&#039;vectorDetail&#039;].forEach(id=&gt;$(id).addEventListener(&#039;change&#039;,vectorInputChanged));\r\n$(&#039;vectorDialog&#039;).addEventListener(&#039;close&#039;,()=&gt;{cancelVectorJob();clearVectorResult();});\r\nwindow.addEventListener(&#039;pagehide&#039;,()=&gt;{cancelVectorJob();clearVectorResult();});\r\n\/\/ END SHANDE_VECTOR_TRACING_V1\r\n\r\n\/\/ Retouch controls and small, local adjustment thumbnails.\r\nlet retouchThumbSource = null, retouchThumbImage = null, retouchThumbRevision = -1, retouchThumbLayer = null;\r\nfunction refreshRetouchPreviews(force = false) {\r\n  const before = $(&#039;adjustBeforeThumb&#039;), after = $(&#039;adjustAfterThumb&#039;); if (!before || !after) return;\r\n  const l = active(), usable = !!l &amp;&amp; l.type === &#039;image&#039;;\r\n  [...adjustIds, &#039;grayscale&#039;, &#039;clearAdjust&#039;].forEach(id =&gt; $(id).disabled = !usable);\r\n  document.querySelectorAll(&#039;[data-adjust-reset]&#039;).forEach(button =&gt; button.disabled = !usable);\r\n  $(&#039;adjustPreviewHint&#039;).textContent = usable ? &#039;\u5de6\u4fa7\u4fdd\u7559\u8c03\u8272\u524d\u6548\u679c\uff0c\u53f3\u4fa7\u968f\u6ed1\u5757\u66f4\u65b0\u3002&#039; : &#039;\u9009\u4e2d\u56fe\u7247\u540e\u663e\u793a\u8c03\u8272\u5bf9\u6bd4\u3002&#039;;\r\n  if (!usable) {\r\n    [before, after].forEach(canvas =&gt; canvas.getContext(&#039;2d&#039;).clearRect(0, 0, canvas.width, canvas.height));\r\n    if (retouchThumbSource) C.release(retouchThumbSource);\r\n    retouchThumbSource = retouchThumbImage = retouchThumbLayer = null; retouchThumbRevision = -1; return;\r\n  }\r\n  if (workspaceMode !== &#039;color&#039; &amp;&amp; !force) return;\r\n  if (!retouchThumbSource || retouchThumbImage !== l.image || retouchThumbLayer !== l.id || retouchThumbRevision !== editRevision || force) {\r\n    if (retouchThumbSource) C.release(retouchThumbSource);\r\n    const scale = Math.min(1, 180 \/ l.image.width, 128 \/ l.image.height);\r\n    retouchThumbSource = C.resize(l.image, Math.max(1, Math.round(l.image.width * scale)), Math.max(1, Math.round(l.image.height * scale)));\r\n    retouchThumbImage = l.image; retouchThumbLayer = l.id; retouchThumbRevision = editRevision;\r\n  }\r\n  function putThumb(canvas, source) { canvas.width = source.width; canvas.height = source.height; canvas.getContext(&#039;2d&#039;).drawImage(source, 0, 0); }\r\n  putThumb(before, retouchThumbSource);\r\n  const next = C.adjust(retouchThumbSource, adjustValues()); putThumb(after, next); C.release(next);\r\n}\r\nfunction syncRetouchControls() {\r\n  const usesSettings = [&#039;paint&#039;, &#039;blur&#039;, &#039;erase&#039;, &#039;restore&#039;].includes(tool), usable = !!active() &amp;&amp; active().type === &#039;image&#039;;\r\n  $(&#039;retouchSoftSettings&#039;).hidden = !usesSettings;\r\n  $(&#039;retouchColorField&#039;).hidden = tool !== &#039;paint&#039;;\r\n  $(&#039;retouchBlurField&#039;).hidden = tool !== &#039;blur&#039;;\r\n  $(&#039;retouchMosaicField&#039;).hidden = tool !== &#039;mosaic&#039;;\r\n  $(&#039;retouchSizeField&#039;).hidden = !usesSettings &amp;&amp; tool !== &#039;mosaic&#039;;\r\n  document.querySelectorAll(&#039;[data-image-part=&quot;brush&quot;] [data-tool]&#039;).forEach(button =&gt; button.disabled = button.dataset.tool !== &#039;pick&#039; &amp;&amp; !usable);\r\n  [&#039;brushSoftness&#039;, &#039;brushStrength&#039;, &#039;blurRadius&#039;].forEach(id =&gt; $(id + &#039;Value&#039;).value = $(id).value + (id === &#039;blurRadius&#039; ? &#039; px&#039; : &#039;%&#039;));\r\n  if (tool === &#039;paint&#039;) $(&#039;toolHint&#039;).textContent = &#039;\u5728\u5f53\u524d\u56fe\u7247\u4e0a\u6d82\u9e26\uff0c\u53ef\u9009\u62e9\u989c\u8272\u3001\u67d4\u8fb9\u548c\u5f3a\u5ea6\uff1b\u6bcf\u4e00\u7b14\u90fd\u80fd\u64a4\u9500\u3002&#039;;\r\n  if (tool === &#039;blur&#039;) $(&#039;toolHint&#039;).textContent = &#039;\u5728\u5f53\u524d\u56fe\u7247\u4e0a\u5c40\u90e8\u67d4\u5316\uff1b\u8c03\u6574\u6a21\u7cca\u534a\u5f84\u63a7\u5236\u6548\u679c\uff0c\u6bcf\u4e00\u7b14\u90fd\u80fd\u64a4\u9500\u3002&#039;;\r\n}\r\nconst retouchPreviousSyncInspector = syncInspector;\r\nsyncInspector = function () { retouchPreviousSyncInspector(); syncRetouchControls(); refreshRetouchPreviews(); };\r\n[&#039;brushSoftness&#039;, &#039;brushStrength&#039;, &#039;blurRadius&#039;].forEach(id =&gt; $(id).addEventListener(&#039;input&#039;, syncRetouchControls));\r\ndocument.querySelectorAll(&#039;[data-adjust-reset]&#039;).forEach(button =&gt; button.addEventListener(&#039;click&#039;, () =&gt; {\r\n  const id = button.dataset.adjustReset;\r\n  if (id === &#039;grayscale&#039;) $(&#039;grayscale&#039;).checked = false; else if (adjustIds.includes(id)) $(id).value = 0;\r\n  previewAdjust();\r\n}));\r\n\r\nconst ORIGINAL_POSTER_TEMPLATES = [\r\n  {\r\n    &quot;id&quot;: &quot;sd-parent-growth&quot;,\r\n    &quot;name&quot;: &quot;\u6210\u957f\u6709\u56de\u5e94 \u00b7 \u5bb6\u957f\u4f1a&quot;,\r\n    &quot;category&quot;: &quot;\u6559\u80b2&quot;,\r\n    &quot;width&quot;: 1080,\r\n    &quot;height&quot;: 1440,\r\n    &quot;background&quot;: &quot;#F7FBFF&quot;,\r\n    &quot;layers&quot;: [\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 74,\r\n        &quot;width&quot;: 18,\r\n        &quot;height&quot;: 18,\r\n        &quot;color&quot;: &quot;#2C63E8&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5bb6\u6821\u540c\u884c \u00b7 \u65b0\u751f\u5bb6\u957f\u4f1a&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#2C63E8&quot;,\r\n        &quot;x&quot;: 108,\r\n        &quot;y&quot;: 66,\r\n        &quot;width&quot;: 700,\r\n        &quot;height&quot;: 45\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u628a\u6bcf\u4e00\u6b65\u6210\u957f\\n\u90fd\u63a5\u5728\u624b\u5fc3\u91cc&quot;,\r\n        &quot;fontSize&quot;: 88,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#153451&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 150,\r\n        &quot;width&quot;: 940,\r\n        &quot;height&quot;: 236\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u770b\u89c1\u5b69\u5b50\u7684\u8282\u594f\uff0c\u4e5f\u627e\u5230\u966a\u4f34\u7684\u65b9\u6cd5\u3002&quot;,\r\n        &quot;fontSize&quot;: 34,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#5A7189&quot;,\r\n        &quot;x&quot;: 76,\r\n        &quot;y&quot;: 410,\r\n        &quot;width&quot;: 930,\r\n        &quot;height&quot;: 55\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 896,\r\n        &quot;y&quot;: 508,\r\n        &quot;width&quot;: 70,\r\n        &quot;height&quot;: 70,\r\n        &quot;color&quot;: &quot;#FFCD65&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 850,\r\n        &quot;y&quot;: 562,\r\n        &quot;width&quot;: 24,\r\n        &quot;height&quot;: 24,\r\n        &quot;color&quot;: &quot;#8FD4EA&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 686,\r\n        &quot;width&quot;: 240,\r\n        &quot;height&quot;: 166,\r\n        &quot;color&quot;: &quot;#E3EDFF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 332,\r\n        &quot;y&quot;: 620,\r\n        &quot;width&quot;: 240,\r\n        &quot;height&quot;: 232,\r\n        &quot;color&quot;: &quot;#C9DCFF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 592,\r\n        &quot;y&quot;: 554,\r\n        &quot;width&quot;: 240,\r\n        &quot;height&quot;: 298,\r\n        &quot;color&quot;: &quot;#2C63E8&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;01&quot;,\r\n        &quot;fontSize&quot;: 28,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#5279B8&quot;,\r\n        &quot;x&quot;: 92,\r\n        &quot;y&quot;: 704,\r\n        &quot;width&quot;: 150,\r\n        &quot;height&quot;: 44\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u770b\u89c1&quot;,\r\n        &quot;fontSize&quot;: 42,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#173E70&quot;,\r\n        &quot;x&quot;: 92,\r\n        &quot;y&quot;: 750,\r\n        &quot;width&quot;: 200,\r\n        &quot;height&quot;: 62\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;02&quot;,\r\n        &quot;fontSize&quot;: 28,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#5279B8&quot;,\r\n        &quot;x&quot;: 354,\r\n        &quot;y&quot;: 642,\r\n        &quot;width&quot;: 150,\r\n        &quot;height&quot;: 44\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u7406\u89e3&quot;,\r\n        &quot;fontSize&quot;: 42,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#173E70&quot;,\r\n        &quot;x&quot;: 354,\r\n        &quot;y&quot;: 688,\r\n        &quot;width&quot;: 190,\r\n        &quot;height&quot;: 62\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u63a5\u4f4f\u60c5\u7eea\\n\u8bfb\u61c2\u9700\u8981&quot;,\r\n        &quot;fontSize&quot;: 26,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#426184&quot;,\r\n        &quot;x&quot;: 354,\r\n        &quot;y&quot;: 756,\r\n        &quot;width&quot;: 190,\r\n        &quot;height&quot;: 78\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;03&quot;,\r\n        &quot;fontSize&quot;: 28,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#CDE0FF&quot;,\r\n        &quot;x&quot;: 614,\r\n        &quot;y&quot;: 576,\r\n        &quot;width&quot;: 150,\r\n        &quot;height&quot;: 44\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u966a\u4f34&quot;,\r\n        &quot;fontSize&quot;: 42,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#FFFFFF&quot;,\r\n        &quot;x&quot;: 614,\r\n        &quot;y&quot;: 625,\r\n        &quot;width&quot;: 190,\r\n        &quot;height&quot;: 62\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u628a\u65e5\u5e38\u7684\u5c0f\u4e8b\\n\u53d8\u6210\u6210\u957f\u7684\u652f\u6301&quot;,\r\n        &quot;fontSize&quot;: 26,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#FFFFFF&quot;,\r\n        &quot;x&quot;: 614,\r\n        &quot;y&quot;: 702,\r\n        &quot;width&quot;: 202,\r\n        &quot;height&quot;: 105\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 858,\r\n        &quot;y&quot;: 818,\r\n        &quot;width&quot;: 110,\r\n        &quot;height&quot;: 5,\r\n        &quot;color&quot;: &quot;#C9DAED&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u6bcf\u4e00\u6b65\\n\u90fd\u7b97\u6570&quot;,\r\n        &quot;fontSize&quot;: 29,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#436B94&quot;,\r\n        &quot;x&quot;: 852,\r\n        &quot;y&quot;: 724,\r\n        &quot;width&quot;: 160,\r\n        &quot;height&quot;: 81\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u4e00\u6b21\u771f\u6b63\u6709\u7528\u7684\u5bb6\u6821\u4ea4\u6d41&quot;,\r\n        &quot;fontSize&quot;: 42,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#153451&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 912,\r\n        &quot;width&quot;: 900,\r\n        &quot;height&quot;: 62\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;01  \u9002\u5e94\u65b0\u73af\u5883&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#24445F&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1000,\r\n        &quot;width&quot;: 445,\r\n        &quot;height&quot;: 44\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u4f5c\u606f\u3001\u51c6\u5907\u4e0e\u5165\u5b66\u540e\u7684\u60c5\u7eea\u652f\u6301&quot;,\r\n        &quot;fontSize&quot;: 24,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#667B8E&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1054,\r\n        &quot;width&quot;: 450,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;02  \u5efa\u7acb\u597d\u4e60\u60ef&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#24445F&quot;,\r\n        &quot;x&quot;: 564,\r\n        &quot;y&quot;: 1000,\r\n        &quot;width&quot;: 445,\r\n        &quot;height&quot;: 44\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u628a\u81ea\u7406\u4e0e\u4e13\u6ce8\uff0c\u7ec3\u8fdb\u6bcf\u5929\u7684\u5c0f\u4e8b&quot;,\r\n        &quot;fontSize&quot;: 24,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#667B8E&quot;,\r\n        &quot;x&quot;: 564,\r\n        &quot;y&quot;: 1054,\r\n        &quot;width&quot;: 450,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1160,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 136,\r\n        &quot;color&quot;: &quot;#E8F1FF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u65f6\u95f4&quot;,\r\n        &quot;fontSize&quot;: 25,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#5C7291&quot;,\r\n        &quot;x&quot;: 100,\r\n        &quot;y&quot;: 1182,\r\n        &quot;width&quot;: 112,\r\n        &quot;height&quot;: 42\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;10\u670824\u65e5  14:00\u201416:00&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#173E70&quot;,\r\n        &quot;x&quot;: 218,\r\n        &quot;y&quot;: 1182,\r\n        &quot;width&quot;: 748,\r\n        &quot;height&quot;: 46\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5730\u70b9&quot;,\r\n        &quot;fontSize&quot;: 25,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#5C7291&quot;,\r\n        &quot;x&quot;: 100,\r\n        &quot;y&quot;: 1235,\r\n        &quot;width&quot;: 112,\r\n        &quot;height&quot;: 42\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5b66\u6821\u62a5\u544a\u5385 \u00b7 \u8bf7\u63d0\u524d 10 \u5206\u949f\u5165\u573a&quot;,\r\n        &quot;fontSize&quot;: 26,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#345976&quot;,\r\n        &quot;x&quot;: 218,\r\n        &quot;y&quot;: 1235,\r\n        &quot;width&quot;: 748,\r\n        &quot;height&quot;: 42\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1346,\r\n        &quot;width&quot;: 42,\r\n        &quot;height&quot;: 4,\r\n        &quot;color&quot;: &quot;#2C63E8&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u8ba9\u5bb6\u6821\u7684\u6bcf\u4e00\u6b21\u6c9f\u901a\uff0c\u90fd\u6210\u4e3a\u5b69\u5b50\u5411\u524d\u7684\u529b\u91cf\u3002&quot;,\r\n        &quot;fontSize&quot;: 25,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#718399&quot;,\r\n        &quot;x&quot;: 136,\r\n        &quot;y&quot;: 1327,\r\n        &quot;width&quot;: 870,\r\n        &quot;height&quot;: 56\r\n      }\r\n    ]\r\n  },\r\n  {\r\n    &quot;id&quot;: &quot;sd-light-product&quot;,\r\n    &quot;name&quot;: &quot;\u8f7b\u88c5\u51fa\u53d1 \u00b7 \u65b0\u54c1\u53d1\u5e03&quot;,\r\n    &quot;category&quot;: &quot;\u4ea7\u54c1&quot;,\r\n    &quot;width&quot;: 1080,\r\n    &quot;height&quot;: 1440,\r\n    &quot;background&quot;: &quot;#F8F7FF&quot;,\r\n    &quot;layers&quot;: [\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 76,\r\n        &quot;width&quot;: 50,\r\n        &quot;height&quot;: 8,\r\n        &quot;color&quot;: &quot;#6355CF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u8f7b\u884c\u65e5\u5e38 \/ NEW ARRIVAL&quot;,\r\n        &quot;fontSize&quot;: 28,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#6355CF&quot;,\r\n        &quot;x&quot;: 144,\r\n        &quot;y&quot;: 62,\r\n        &quot;width&quot;: 820,\r\n        &quot;height&quot;: 46\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u8f7b\u88c5\u51fa\u53d1\\n\u65e5\u5e38\u4e0a\u65b0&quot;,\r\n        &quot;fontSize&quot;: 100,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#29234E&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 152,\r\n        &quot;width&quot;: 860,\r\n        &quot;height&quot;: 256\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u628a\u9700\u8981\u5e26\u5728\u8eab\u8fb9\uff0c\u628a\u8f7b\u677e\u7559\u7ed9\u81ea\u5df1\u3002&quot;,\r\n        &quot;fontSize&quot;: 34,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#7B7394&quot;,\r\n        &quot;x&quot;: 76,\r\n        &quot;y&quot;: 441,\r\n        &quot;width&quot;: 910,\r\n        &quot;height&quot;: 55\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 548,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 406,\r\n        &quot;color&quot;: &quot;#E9E4FC&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 748,\r\n        &quot;y&quot;: 576,\r\n        &quot;width&quot;: 206,\r\n        &quot;height&quot;: 206,\r\n        &quot;color&quot;: &quot;#F7C87A&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 798,\r\n        &quot;y&quot;: 598,\r\n        &quot;width&quot;: 106,\r\n        &quot;height&quot;: 106,\r\n        &quot;color&quot;: &quot;#FADEAA&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 553,\r\n        &quot;y&quot;: 588,\r\n        &quot;width&quot;: 222,\r\n        &quot;height&quot;: 171,\r\n        &quot;color&quot;: &quot;#5545B4&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 582,\r\n        &quot;y&quot;: 617,\r\n        &quot;width&quot;: 164,\r\n        &quot;height&quot;: 138,\r\n        &quot;color&quot;: &quot;#E9E4FC&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 484,\r\n        &quot;y&quot;: 704,\r\n        &quot;width&quot;: 356,\r\n        &quot;height&quot;: 202,\r\n        &quot;color&quot;: &quot;#6554CC&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 500,\r\n        &quot;y&quot;: 719,\r\n        &quot;width&quot;: 324,\r\n        &quot;height&quot;: 168,\r\n        &quot;color&quot;: &quot;#7766DC&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 532,\r\n        &quot;y&quot;: 750,\r\n        &quot;width&quot;: 260,\r\n        &quot;height&quot;: 5,\r\n        &quot;color&quot;: &quot;#B5A5FF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 662,\r\n        &quot;y&quot;: 774,\r\n        &quot;width&quot;: 84,\r\n        &quot;height&quot;: 56,\r\n        &quot;color&quot;: &quot;#D3C9FF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 460,\r\n        &quot;y&quot;: 849,\r\n        &quot;width&quot;: 24,\r\n        &quot;height&quot;: 24,\r\n        &quot;color&quot;: &quot;#F7C87A&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 864,\r\n        &quot;y&quot;: 868,\r\n        &quot;width&quot;: 13,\r\n        &quot;height&quot;: 13,\r\n        &quot;color&quot;: &quot;#A99BE6&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u8f7b\u884c&quot;,\r\n        &quot;fontSize&quot;: 58,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#423773&quot;,\r\n        &quot;x&quot;: 108,\r\n        &quot;y&quot;: 592,\r\n        &quot;width&quot;: 320,\r\n        &quot;height&quot;: 80\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u65e5\u5e38\u968f\u884c\u5305&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#645B83&quot;,\r\n        &quot;x&quot;: 108,\r\n        &quot;y&quot;: 679,\r\n        &quot;width&quot;: 310,\r\n        &quot;height&quot;: 55\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u4e0d\u6b62\u88c5\u4e0b\u7269\u54c1\\n\u4e5f\u88c5\u4e0b\u751f\u6d3b\u7684\u4ece\u5bb9&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#716887&quot;,\r\n        &quot;x&quot;: 108,\r\n        &quot;y&quot;: 791,\r\n        &quot;width&quot;: 330,\r\n        &quot;height&quot;: 96\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5c0f\u4f53\u79ef\uff0c\u5927\u81ea\u5728\u3002&quot;,\r\n        &quot;fontSize&quot;: 42,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#29234E&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1004,\r\n        &quot;width&quot;: 900,\r\n        &quot;height&quot;: 61\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u8f7b\u91cf\u6536\u7eb3&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#514776&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1098,\r\n        &quot;width&quot;: 280,\r\n        &quot;height&quot;: 45\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u901a\u52e4\u968f\u884c&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#514776&quot;,\r\n        &quot;x&quot;: 401,\r\n        &quot;y&quot;: 1098,\r\n        &quot;width&quot;: 280,\r\n        &quot;height&quot;: 45\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u7b80\u6d01\u8010\u770b&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#514776&quot;,\r\n        &quot;x&quot;: 730,\r\n        &quot;y&quot;: 1098,\r\n        &quot;width&quot;: 280,\r\n        &quot;height&quot;: 45\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5e38\u7528\u7269\u54c1\uff0c\u5404\u6709\u4f4d\u7f6e&quot;,\r\n        &quot;fontSize&quot;: 24,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#89809D&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1152,\r\n        &quot;width&quot;: 285,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u65e5\u5e38\u51fa\u95e8\uff0c\u8f7b\u677e\u5207\u6362&quot;,\r\n        &quot;fontSize&quot;: 24,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#89809D&quot;,\r\n        &quot;x&quot;: 401,\r\n        &quot;y&quot;: 1152,\r\n        &quot;width&quot;: 285,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u8ba9\u642d\u914d\u56de\u5f52\u7b80\u5355&quot;,\r\n        &quot;fontSize&quot;: 24,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#89809D&quot;,\r\n        &quot;x&quot;: 730,\r\n        &quot;y&quot;: 1152,\r\n        &quot;width&quot;: 280,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1236,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 2,\r\n        &quot;color&quot;: &quot;#D9D2EF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u65b0\u54c1\u4f53\u9a8c\u4ef7&quot;,\r\n        &quot;fontSize&quot;: 27,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#7C709E&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1293,\r\n        &quot;width&quot;: 250,\r\n        &quot;height&quot;: 43\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u00a5129&quot;,\r\n        &quot;fontSize&quot;: 70,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#6355CF&quot;,\r\n        &quot;x&quot;: 340,\r\n        &quot;y&quot;: 1257,\r\n        &quot;width&quot;: 310,\r\n        &quot;height&quot;: 96\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 726,\r\n        &quot;y&quot;: 1278,\r\n        &quot;width&quot;: 282,\r\n        &quot;height&quot;: 73,\r\n        &quot;color&quot;: &quot;#6355CF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5373\u523b\u63a2\u7d22\u65b0\u54c1&quot;,\r\n        &quot;fontSize&quot;: 29,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;center&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#FFFFFF&quot;,\r\n        &quot;x&quot;: 746,\r\n        &quot;y&quot;: 1294,\r\n        &quot;width&quot;: 244,\r\n        &quot;height&quot;: 42\r\n      }\r\n    ]\r\n  },\r\n  {\r\n    &quot;id&quot;: &quot;sd-reading-club&quot;,\r\n    &quot;name&quot;: &quot;\u7559\u7ed9\u4e00\u672c\u4e66 \u00b7 \u5468\u672b\u5171\u8bfb&quot;,\r\n    &quot;category&quot;: &quot;\u9605\u8bfb&quot;,\r\n    &quot;width&quot;: 1080,\r\n    &quot;height&quot;: 1440,\r\n    &quot;background&quot;: &quot;#F5FAF6&quot;,\r\n    &quot;layers&quot;: [\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5468\u672b\u5171\u8bfb\u8ba1\u5212&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#387458&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 70,\r\n        &quot;width&quot;: 560,\r\n        &quot;height&quot;: 48\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;VOL. 01&quot;,\r\n        &quot;fontSize&quot;: 28,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;right&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#739781&quot;,\r\n        &quot;x&quot;: 807,\r\n        &quot;y&quot;: 70,\r\n        &quot;width&quot;: 201,\r\n        &quot;height&quot;: 48\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 137,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 2,\r\n        &quot;color&quot;: &quot;#CBDDCF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u628a\u65f6\u95f4\\n\u7559\u7ed9\u4e00\u672c\u4e66&quot;,\r\n        &quot;fontSize&quot;: 100,\r\n        &quot;fontFamily&quot;: &quot;serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#204E3A&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 199,\r\n        &quot;width&quot;: 938,\r\n        &quot;height&quot;: 256\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 78,\r\n        &quot;y&quot;: 492,\r\n        &quot;width&quot;: 5,\r\n        &quot;height&quot;: 110,\r\n        &quot;color&quot;: &quot;#E8AB64&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u4e0d\u6025\u7740\u8bfb\u5b8c\uff0c\\n\u5148\u8bfb\u61c2\u6253\u52a8\u4f60\u7684\u90a3\u4e00\u9875\u3002&quot;,\r\n        &quot;fontSize&quot;: 36,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#5D7A68&quot;,\r\n        &quot;x&quot;: 112,\r\n        &quot;y&quot;: 486,\r\n        &quot;width&quot;: 880,\r\n        &quot;height&quot;: 105\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 731,\r\n        &quot;y&quot;: 617,\r\n        &quot;width&quot;: 194,\r\n        &quot;height&quot;: 194,\r\n        &quot;color&quot;: &quot;#EADDA8&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 164,\r\n        &quot;y&quot;: 712,\r\n        &quot;width&quot;: 756,\r\n        &quot;height&quot;: 246,\r\n        &quot;color&quot;: &quot;#DAEADD&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 238,\r\n        &quot;y&quot;: 672,\r\n        &quot;width&quot;: 278,\r\n        &quot;height&quot;: 255,\r\n        &quot;color&quot;: &quot;#FFFFFF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 528,\r\n        &quot;y&quot;: 672,\r\n        &quot;width&quot;: 278,\r\n        &quot;height&quot;: 255,\r\n        &quot;color&quot;: &quot;#FFFFFF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 516,\r\n        &quot;y&quot;: 680,\r\n        &quot;width&quot;: 12,\r\n        &quot;height&quot;: 249,\r\n        &quot;color&quot;: &quot;#B6D0BC&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 268,\r\n        &quot;y&quot;: 716,\r\n        &quot;width&quot;: 136,\r\n        &quot;height&quot;: 10,\r\n        &quot;color&quot;: &quot;#548569&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 268,\r\n        &quot;y&quot;: 751,\r\n        &quot;width&quot;: 210,\r\n        &quot;height&quot;: 5,\r\n        &quot;color&quot;: &quot;#D8E7DA&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 268,\r\n        &quot;y&quot;: 783,\r\n        &quot;width&quot;: 210,\r\n        &quot;height&quot;: 5,\r\n        &quot;color&quot;: &quot;#D8E7DA&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 268,\r\n        &quot;y&quot;: 815,\r\n        &quot;width&quot;: 164,\r\n        &quot;height&quot;: 5,\r\n        &quot;color&quot;: &quot;#D8E7DA&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 588,\r\n        &quot;y&quot;: 713,\r\n        &quot;width&quot;: 122,\r\n        &quot;height&quot;: 122,\r\n        &quot;color&quot;: &quot;#EDF2DC&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 558,\r\n        &quot;y&quot;: 864,\r\n        &quot;width&quot;: 210,\r\n        &quot;height&quot;: 5,\r\n        &quot;color&quot;: &quot;#D8E7DA&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 558,\r\n        &quot;y&quot;: 885,\r\n        &quot;width&quot;: 155,\r\n        &quot;height&quot;: 5,\r\n        &quot;color&quot;: &quot;#D8E7DA&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 142,\r\n        &quot;y&quot;: 646,\r\n        &quot;width&quot;: 25,\r\n        &quot;height&quot;: 25,\r\n        &quot;color&quot;: &quot;#C8D9BE&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 856,\r\n        &quot;y&quot;: 901,\r\n        &quot;width&quot;: 32,\r\n        &quot;height&quot;: 32,\r\n        &quot;color&quot;: &quot;#E8AB64&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u8bfb\u4e00\u6bb5&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#2D6148&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1018,\r\n        &quot;width&quot;: 270,\r\n        &quot;height&quot;: 47\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5206\u4eab\u4f60\u559c\u6b22\u7684\u6bb5\u843d&quot;,\r\n        &quot;fontSize&quot;: 24,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#708675&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1076,\r\n        &quot;width&quot;: 290,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u804a\u4e00\u804a&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#2D6148&quot;,\r\n        &quot;x&quot;: 401,\r\n        &quot;y&quot;: 1018,\r\n        &quot;width&quot;: 270,\r\n        &quot;height&quot;: 47\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u8ba9\u4e0d\u540c\u7684\u611f\u53d7\u76f8\u9047&quot;,\r\n        &quot;fontSize&quot;: 24,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#708675&quot;,\r\n        &quot;x&quot;: 401,\r\n        &quot;y&quot;: 1076,\r\n        &quot;width&quot;: 290,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5e26\u8d70\u4e00\u53e5&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#2D6148&quot;,\r\n        &quot;x&quot;: 730,\r\n        &quot;y&quot;: 1018,\r\n        &quot;width&quot;: 278,\r\n        &quot;height&quot;: 47\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u7559\u4e0b\u4e00\u70b9\u81ea\u5df1\u7684\u601d\u8003&quot;,\r\n        &quot;fontSize&quot;: 24,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#708675&quot;,\r\n        &quot;x&quot;: 730,\r\n        &quot;y&quot;: 1076,\r\n        &quot;width&quot;: 278,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1170,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 2,\r\n        &quot;color&quot;: &quot;#CBDDCF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;10\u670825\u65e5 \u00b7 \u5468\u65e5 \u00b7 15:00&quot;,\r\n        &quot;fontSize&quot;: 36,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#2D6148&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1212,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 54\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u793e\u533a\u9605\u8bfb\u7a7a\u95f4  \/  \u5e26\u4e00\u672c\u6b63\u5728\u8bfb\u7684\u4e66\uff0c\u5c31\u53ef\u4ee5\u6765&quot;,\r\n        &quot;fontSize&quot;: 29,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#64816D&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1280,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 47\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u6ca1\u6709\u6807\u51c6\u7b54\u6848\uff0c\u4e5f\u4e0d\u9700\u8981\u9884\u5148\u6210\u4e3a\u201c\u5f88\u4f1a\u8bfb\u4e66\u7684\u4eba\u201d\u3002&quot;,\r\n        &quot;fontSize&quot;: 23,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#859A8B&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1360,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 39\r\n      }\r\n    ]\r\n  },\r\n  {\r\n    &quot;id&quot;: &quot;sd-studio-notice&quot;,\r\n    &quot;name&quot;: &quot;\u6709\u5e8f\u5b89\u6392 \u00b7 \u7b80\u6d01\u901a\u77e5&quot;,\r\n    &quot;category&quot;: &quot;\u901a\u77e5&quot;,\r\n    &quot;width&quot;: 1080,\r\n    &quot;height&quot;: 1440,\r\n    &quot;background&quot;: &quot;#FFFFFF&quot;,\r\n    &quot;layers&quot;: [\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 0,\r\n        &quot;y&quot;: 0,\r\n        &quot;width&quot;: 1080,\r\n        &quot;height&quot;: 18,\r\n        &quot;color&quot;: &quot;#2B60D6&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5de5\u4f5c\u5ba4\u516c\u544a&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#2B60D6&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 81,\r\n        &quot;width&quot;: 720,\r\n        &quot;height&quot;: 50\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;NO. 01&quot;,\r\n        &quot;fontSize&quot;: 28,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;right&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#7D8AA0&quot;,\r\n        &quot;x&quot;: 800,\r\n        &quot;y&quot;: 82,\r\n        &quot;width&quot;: 208,\r\n        &quot;height&quot;: 46\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u901a\u77e5&quot;,\r\n        &quot;fontSize&quot;: 146,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#182D4D&quot;,\r\n        &quot;x&quot;: 66,\r\n        &quot;y&quot;: 165,\r\n        &quot;width&quot;: 900,\r\n        &quot;height&quot;: 190\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 393,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 3,\r\n        &quot;color&quot;: &quot;#203C69&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5f00\u653e\u65f6\u95f4\u8c03\u6574&quot;,\r\n        &quot;fontSize&quot;: 60,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#182D4D&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 449,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 85\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u4e3a\u65b9\u4fbf\u5927\u5bb6\u9519\u5cf0\u5230\u8bbf\uff0c\u5de5\u4f5c\u5ba4\u5c06\u8c03\u6574\u5f00\u653e\u65f6\u6bb5\u3002\\n\u5df2\u9884\u7ea6\u7684\u8bfe\u7a0b\u4e0e\u6d3b\u52a8\u6309\u539f\u8ba1\u5212\u8fdb\u884c\uff0c\\n\u5982\u9700\u53d8\u66f4\uff0c\u8bf7\u63d0\u524d\u4e0e\u6211\u4eec\u8054\u7cfb\u3002&quot;,\r\n        &quot;fontSize&quot;: 31,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#62728A&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 571,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 154\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;01&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#2B60D6&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 782,\r\n        &quot;width&quot;: 92,\r\n        &quot;height&quot;: 50\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u6267\u884c\u65e5\u671f&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#253E61&quot;,\r\n        &quot;x&quot;: 192,\r\n        &quot;y&quot;: 782,\r\n        &quot;width&quot;: 252,\r\n        &quot;height&quot;: 48\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;2026\u5e7410\u670826\u65e5\u8d77&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#253E61&quot;,\r\n        &quot;x&quot;: 486,\r\n        &quot;y&quot;: 782,\r\n        &quot;width&quot;: 522,\r\n        &quot;height&quot;: 48\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 192,\r\n        &quot;y&quot;: 850,\r\n        &quot;width&quot;: 816,\r\n        &quot;height&quot;: 2,\r\n        &quot;color&quot;: &quot;#E3EAF3&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;02&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#2B60D6&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 889,\r\n        &quot;width&quot;: 92,\r\n        &quot;height&quot;: 50\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5f00\u653e\u65f6\u6bb5&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#253E61&quot;,\r\n        &quot;x&quot;: 192,\r\n        &quot;y&quot;: 889,\r\n        &quot;width&quot;: 252,\r\n        &quot;height&quot;: 48\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5468\u4e8c\u81f3\u5468\u65e5  10:00\u201418:00&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#253E61&quot;,\r\n        &quot;x&quot;: 486,\r\n        &quot;y&quot;: 889,\r\n        &quot;width&quot;: 522,\r\n        &quot;height&quot;: 48\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 192,\r\n        &quot;y&quot;: 957,\r\n        &quot;width&quot;: 816,\r\n        &quot;height&quot;: 2,\r\n        &quot;color&quot;: &quot;#E3EAF3&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;03&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#2B60D6&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 996,\r\n        &quot;width&quot;: 92,\r\n        &quot;height&quot;: 50\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u6bcf\u5468\u4f11\u606f&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#253E61&quot;,\r\n        &quot;x&quot;: 192,\r\n        &quot;y&quot;: 996,\r\n        &quot;width&quot;: 252,\r\n        &quot;height&quot;: 48\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5468\u4e00\u95ed\u9986\uff0c\u8282\u5047\u65e5\u53e6\u884c\u901a\u77e5&quot;,\r\n        &quot;fontSize&quot;: 30,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#253E61&quot;,\r\n        &quot;x&quot;: 486,\r\n        &quot;y&quot;: 996,\r\n        &quot;width&quot;: 522,\r\n        &quot;height&quot;: 48\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1100,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 156,\r\n        &quot;color&quot;: &quot;#F0F5FF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 96,\r\n        &quot;y&quot;: 1127,\r\n        &quot;width&quot;: 5,\r\n        &quot;height&quot;: 101,\r\n        &quot;color&quot;: &quot;#2B60D6&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5230\u8bbf\u63d0\u9192&quot;,\r\n        &quot;fontSize&quot;: 28,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#2B60D6&quot;,\r\n        &quot;x&quot;: 121,\r\n        &quot;y&quot;: 1122,\r\n        &quot;width&quot;: 840,\r\n        &quot;height&quot;: 45\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5efa\u8bae\u63d0\u524d\u9884\u7ea6\uff1b\u5982\u9047\u4e34\u65f6\u8c03\u6574\uff0c\u4ee5\u6700\u65b0\u516c\u544a\u4e3a\u51c6\u3002&quot;,\r\n        &quot;fontSize&quot;: 27,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#627A9B&quot;,\r\n        &quot;x&quot;: 121,\r\n        &quot;y&quot;: 1181,\r\n        &quot;width&quot;: 840,\r\n        &quot;height&quot;: 41\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u611f\u8c22\u7406\u89e3\u4e0e\u914d\u5408\u3002&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#253E61&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1322,\r\n        &quot;width&quot;: 576,\r\n        &quot;height&quot;: 50\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5de5\u4f5c\u5ba4\u8fd0\u8425\u7ec4\\n2026\u5e7410\u670820\u65e5&quot;,\r\n        &quot;fontSize&quot;: 26,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;right&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#7D8AA0&quot;,\r\n        &quot;x&quot;: 720,\r\n        &quot;y&quot;: 1310,\r\n        &quot;width&quot;: 288,\r\n        &quot;height&quot;: 80\r\n      }\r\n    ]\r\n  },\r\n  {\r\n    &quot;id&quot;: &quot;sd-city-live&quot;,\r\n    &quot;name&quot;: &quot;\u57ce\u5e02\u5fae\u5149 \u00b7 \u79cb\u65e5\u97f3\u4e50\u4f1a&quot;,\r\n    &quot;category&quot;: &quot;\u6587\u5316\u6d3b\u52a8&quot;,\r\n    &quot;width&quot;: 1080,\r\n    &quot;height&quot;: 1440,\r\n    &quot;background&quot;: &quot;#FFF9F1&quot;,\r\n    &quot;layers&quot;: [\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 72,\r\n        &quot;width&quot;: 18,\r\n        &quot;height&quot;: 18,\r\n        &quot;color&quot;: &quot;#D65F40&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u57ce\u5e02\u6587\u5316\u5468 \/ WEEKEND LIVE&quot;,\r\n        &quot;fontSize&quot;: 28,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#AB654E&quot;,\r\n        &quot;x&quot;: 108,\r\n        &quot;y&quot;: 62,\r\n        &quot;width&quot;: 900,\r\n        &quot;height&quot;: 48\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u57ce\u5e02\u5fae\u5149\\n\u79cb\u65e5\u97f3\u4e50\u4f1a&quot;,\r\n        &quot;fontSize&quot;: 88,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#263F3E&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 155,\r\n        &quot;width&quot;: 930,\r\n        &quot;height&quot;: 232\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 76,\r\n        &quot;y&quot;: 428,\r\n        &quot;width&quot;: 78,\r\n        &quot;height&quot;: 5,\r\n        &quot;color&quot;: &quot;#D65F40&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u628a\u666e\u901a\u7684\u5468\u672b\uff0c\u8fc7\u6210\u503c\u5f97\u8bb0\u4f4f\u7684\u4e00\u665a\u3002&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#7F8070&quot;,\r\n        &quot;x&quot;: 177,\r\n        &quot;y&quot;: 410,\r\n        &quot;width&quot;: 825,\r\n        &quot;height&quot;: 57\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 526,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 440,\r\n        &quot;color&quot;: &quot;#F2E9D9&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 678,\r\n        &quot;y&quot;: 548,\r\n        &quot;width&quot;: 258,\r\n        &quot;height&quot;: 258,\r\n        &quot;color&quot;: &quot;#E7A369&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 581,\r\n        &quot;y&quot;: 609,\r\n        &quot;width&quot;: 316,\r\n        &quot;height&quot;: 316,\r\n        &quot;color&quot;: &quot;#2E6460&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 621,\r\n        &quot;y&quot;: 649,\r\n        &quot;width&quot;: 236,\r\n        &quot;height&quot;: 236,\r\n        &quot;color&quot;: &quot;#39756F&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 661,\r\n        &quot;y&quot;: 689,\r\n        &quot;width&quot;: 156,\r\n        &quot;height&quot;: 156,\r\n        &quot;color&quot;: &quot;#2E6460&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 705,\r\n        &quot;y&quot;: 733,\r\n        &quot;width&quot;: 68,\r\n        &quot;height&quot;: 68,\r\n        &quot;color&quot;: &quot;#F2E9D9&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 869,\r\n        &quot;y&quot;: 699,\r\n        &quot;width&quot;: 10,\r\n        &quot;height&quot;: 153,\r\n        &quot;color&quot;: &quot;#D76E4E&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 850,\r\n        &quot;y&quot;: 837,\r\n        &quot;width&quot;: 49,\r\n        &quot;height&quot;: 37,\r\n        &quot;color&quot;: &quot;#D76E4E&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;19:30&quot;,\r\n        &quot;fontSize&quot;: 82,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#2B5550&quot;,\r\n        &quot;x&quot;: 108,\r\n        &quot;y&quot;: 576,\r\n        &quot;width&quot;: 412,\r\n        &quot;height&quot;: 116\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5468\u516d \u00b7 \u4e00\u8d77\u542c\u73b0\u573a&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#53766B&quot;,\r\n        &quot;x&quot;: 108,\r\n        &quot;y&quot;: 714,\r\n        &quot;width&quot;: 435,\r\n        &quot;height&quot;: 52\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u6709\u719f\u6089\u7684\u65cb\u5f8b\uff0c\\n\u4e5f\u6709\u7b2c\u4e00\u6b21\u9047\u89c1\u7684\u58f0\u97f3\u3002&quot;,\r\n        &quot;fontSize&quot;: 29,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#8E8A70&quot;,\r\n        &quot;x&quot;: 108,\r\n        &quot;y&quot;: 818,\r\n        &quot;width&quot;: 439,\r\n        &quot;height&quot;: 91\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5668\u4e50\u73b0\u573a&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#345D55&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1021,\r\n        &quot;width&quot;: 285,\r\n        &quot;height&quot;: 48\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5373\u5174\u5408\u594f&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#345D55&quot;,\r\n        &quot;x&quot;: 401,\r\n        &quot;y&quot;: 1021,\r\n        &quot;width&quot;: 285,\r\n        &quot;height&quot;: 48\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u81ea\u7531\u4ea4\u6d41&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#345D55&quot;,\r\n        &quot;x&quot;: 730,\r\n        &quot;y&quot;: 1021,\r\n        &quot;width&quot;: 278,\r\n        &quot;height&quot;: 48\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u542c\u89c1\u6bcf\u4e00\u79cd\u4e50\u5668\u7684\u8868\u60c5&quot;,\r\n        &quot;fontSize&quot;: 23,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#90927E&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1075,\r\n        &quot;width&quot;: 304,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u8ba9\u65cb\u5f8b\u5728\u6b64\u523b\u53d1\u751f&quot;,\r\n        &quot;fontSize&quot;: 23,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#90927E&quot;,\r\n        &quot;x&quot;: 401,\r\n        &quot;y&quot;: 1075,\r\n        &quot;width&quot;: 290,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u8ba4\u8bc6\u540c\u6837\u70ed\u7231\u97f3\u4e50\u7684\u4eba&quot;,\r\n        &quot;fontSize&quot;: 23,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#90927E&quot;,\r\n        &quot;x&quot;: 730,\r\n        &quot;y&quot;: 1075,\r\n        &quot;width&quot;: 278,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1170,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 2,\r\n        &quot;color&quot;: &quot;#DACFBA&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;10\u670824\u65e5  19:30\u201421:00&quot;,\r\n        &quot;fontSize&quot;: 35,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#345D55&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1213,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 54\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u57ce\u5e02\u6587\u5316\u7a7a\u95f4 \u00b7 \u4e00\u5c42\u9732\u53f0&quot;,\r\n        &quot;fontSize&quot;: 29,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#7C826F&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1275,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 48\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u9884\u7ea6\u5165\u573a&quot;,\r\n        &quot;fontSize&quot;: 28,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#C26043&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1360,\r\n        &quot;width&quot;: 216,\r\n        &quot;height&quot;: 43\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5173\u6ce8\u6d3b\u52a8\u53d1\u5e03\u9875\uff0c\u67e5\u770b\u62a5\u540d\u65b9\u5f0f\u4e0e\u73b0\u573a\u987b\u77e5\u3002&quot;,\r\n        &quot;fontSize&quot;: 25,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#969A84&quot;,\r\n        &quot;x&quot;: 290,\r\n        &quot;y&quot;: 1364,\r\n        &quot;width&quot;: 718,\r\n        &quot;height&quot;: 40\r\n      }\r\n    ]\r\n  },\r\n  {\r\n    &quot;id&quot;: &quot;sd-open-design-class&quot;,\r\n    &quot;name&quot;: &quot;\u4ece\u96f6\u5f00\u59cb \u00b7 \u6d77\u62a5\u516c\u5f00\u8bfe&quot;,\r\n    &quot;category&quot;: &quot;\u8bfe\u7a0b\u62db\u52df&quot;,\r\n    &quot;width&quot;: 1080,\r\n    &quot;height&quot;: 1440,\r\n    &quot;background&quot;: &quot;#FAF8FF&quot;,\r\n    &quot;layers&quot;: [\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 69,\r\n        &quot;width&quot;: 246,\r\n        &quot;height&quot;: 54,\r\n        &quot;color&quot;: &quot;#EDE6FF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u514d\u8d39\u516c\u5f00\u8bfe&quot;,\r\n        &quot;fontSize&quot;: 26,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;center&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#7352C9&quot;,\r\n        &quot;x&quot;: 87,\r\n        &quot;y&quot;: 77,\r\n        &quot;width&quot;: 215,\r\n        &quot;height&quot;: 38\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;DESIGN FIRST STEP&quot;,\r\n        &quot;fontSize&quot;: 25,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;right&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#AA96C8&quot;,\r\n        &quot;x&quot;: 552,\r\n        &quot;y&quot;: 78,\r\n        &quot;width&quot;: 456,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u4ece\u96f6\u5f00\u59cb\\n\u505a\u4e00\u5f20\u597d\u6d77\u62a5&quot;,\r\n        &quot;fontSize&quot;: 84,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#382653&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 178,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 230\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u8ba9\u4fe1\u606f\u6e05\u695a\uff0c\u8ba9\u753b\u9762\u6709\u81ea\u5df1\u7684\u8868\u8fbe\u3002&quot;,\r\n        &quot;fontSize&quot;: 31,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#89769E&quot;,\r\n        &quot;x&quot;: 76,\r\n        &quot;y&quot;: 437,\r\n        &quot;width&quot;: 925,\r\n        &quot;height&quot;: 50\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 596,\r\n        &quot;y&quot;: 563,\r\n        &quot;width&quot;: 412,\r\n        &quot;height&quot;: 397,\r\n        &quot;color&quot;: &quot;#ECE5F7&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 621,\r\n        &quot;y&quot;: 586,\r\n        &quot;width&quot;: 362,\r\n        &quot;height&quot;: 345,\r\n        &quot;color&quot;: &quot;#FFFFFF&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 641,\r\n        &quot;y&quot;: 608,\r\n        &quot;width&quot;: 320,\r\n        &quot;height&quot;: 6,\r\n        &quot;color&quot;: &quot;#D5C7EC&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 642,\r\n        &quot;y&quot;: 646,\r\n        &quot;width&quot;: 165,\r\n        &quot;height&quot;: 12,\r\n        &quot;color&quot;: &quot;#805BBE&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 642,\r\n        &quot;y&quot;: 678,\r\n        &quot;width&quot;: 124,\r\n        &quot;height&quot;: 12,\r\n        &quot;color&quot;: &quot;#805BBE&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;ellipse&quot;,\r\n        &quot;x&quot;: 806,\r\n        &quot;y&quot;: 648,\r\n        &quot;width&quot;: 129,\r\n        &quot;height&quot;: 129,\r\n        &quot;color&quot;: &quot;#D8E795&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 642,\r\n        &quot;y&quot;: 749,\r\n        &quot;width&quot;: 128,\r\n        &quot;height&quot;: 121,\r\n        &quot;color&quot;: &quot;#B4A2DD&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 794,\r\n        &quot;y&quot;: 817,\r\n        &quot;width&quot;: 140,\r\n        &quot;height&quot;: 7,\r\n        &quot;color&quot;: &quot;#DDD3EC&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 794,\r\n        &quot;y&quot;: 841,\r\n        &quot;width&quot;: 115,\r\n        &quot;height&quot;: 7,\r\n        &quot;color&quot;: &quot;#DDD3EC&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;rect&quot;,\r\n        &quot;x&quot;: 794,\r\n        &quot;y&quot;: 865,\r\n        &quot;width&quot;: 80,\r\n        &quot;height&quot;: 7,\r\n        &quot;color&quot;: &quot;#DDD3EC&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;90&quot;,\r\n        &quot;fontSize&quot;: 116,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#7754BB&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 563,\r\n        &quot;width&quot;: 440,\r\n        &quot;height&quot;: 148\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5206\u949f\uff0c\u5b8c\u6210\u4e00\u6b21\\n\u4ece\u60f3\u6cd5\u5230\u6210\u54c1\u7684\u7ec3\u4e60&quot;,\r\n        &quot;fontSize&quot;: 32,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#71578D&quot;,\r\n        &quot;x&quot;: 76,\r\n        &quot;y&quot;: 724,\r\n        &quot;width&quot;: 493,\r\n        &quot;height&quot;: 94\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u65b0\u624b\u53cb\u597d \u00b7 \u81ea\u5e26\u7535\u8111\u5373\u53ef&quot;,\r\n        &quot;fontSize&quot;: 26,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#9A86AD&quot;,\r\n        &quot;x&quot;: 76,\r\n        &quot;y&quot;: 880,\r\n        &quot;width&quot;: 484,\r\n        &quot;height&quot;: 43\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u8fd9\u4e00\u6b21\uff0c\u6211\u4eec\u4e00\u8d77\u7ec3\u4e60&quot;,\r\n        &quot;fontSize&quot;: 42,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#49365F&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1017,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 63\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;01  \u4fe1\u606f\u53d6\u820d&quot;,\r\n        &quot;fontSize&quot;: 29,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#7754BB&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1120,\r\n        &quot;width&quot;: 280,\r\n        &quot;height&quot;: 44\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u5148\u8bf4\u6e05\u695a\uff0c\u518d\u505a\u6f02\u4eae&quot;,\r\n        &quot;fontSize&quot;: 24,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#9784AA&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1173,\r\n        &quot;width&quot;: 287,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;02  \u7248\u5f0f\u79e9\u5e8f&quot;,\r\n        &quot;fontSize&quot;: 29,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#7754BB&quot;,\r\n        &quot;x&quot;: 402,\r\n        &quot;y&quot;: 1120,\r\n        &quot;width&quot;: 280,\r\n        &quot;height&quot;: 44\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u7528\u5bf9\u9f50\u548c\u7559\u767d\u5efa\u7acb\u5c42\u6b21&quot;,\r\n        &quot;fontSize&quot;: 24,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#9784AA&quot;,\r\n        &quot;x&quot;: 402,\r\n        &quot;y&quot;: 1173,\r\n        &quot;width&quot;: 292,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;03  \u914d\u8272\u4e0e\u5b57\u4f53&quot;,\r\n        &quot;fontSize&quot;: 29,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#7754BB&quot;,\r\n        &quot;x&quot;: 732,\r\n        &quot;y&quot;: 1120,\r\n        &quot;width&quot;: 276,\r\n        &quot;height&quot;: 44\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u8ba9\u6bcf\u4e2a\u9009\u62e9\u6709\u636e\u53ef\u4f9d&quot;,\r\n        &quot;fontSize&quot;: 24,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#9784AA&quot;,\r\n        &quot;x&quot;: 732,\r\n        &quot;y&quot;: 1173,\r\n        &quot;width&quot;: 276,\r\n        &quot;height&quot;: 40\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;shape&quot;,\r\n        &quot;shape&quot;: &quot;roundrect&quot;,\r\n        &quot;x&quot;: 72,\r\n        &quot;y&quot;: 1271,\r\n        &quot;width&quot;: 936,\r\n        &quot;height&quot;: 103,\r\n        &quot;color&quot;: &quot;#7352B5&quot;\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;10\u670825\u65e5 \u00b7 14:00&quot;,\r\n        &quot;fontSize&quot;: 34,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;bold&quot;,\r\n        &quot;align&quot;: &quot;left&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#FFFFFF&quot;,\r\n        &quot;x&quot;: 100,\r\n        &quot;y&quot;: 1299,\r\n        &quot;width&quot;: 476,\r\n        &quot;height&quot;: 50\r\n      },\r\n      {\r\n        &quot;type&quot;: &quot;text&quot;,\r\n        &quot;text&quot;: &quot;\u793e\u533a\u521b\u4f5c\u7a7a\u95f4 \u00b7 \u9650\u989d 20 \u4eba&quot;,\r\n        &quot;fontSize&quot;: 25,\r\n        &quot;fontFamily&quot;: &quot;sans-serif&quot;,\r\n        &quot;fontWeight&quot;: &quot;normal&quot;,\r\n        &quot;align&quot;: &quot;right&quot;,\r\n        &quot;lineHeight&quot;: 1.25,\r\n        &quot;color&quot;: &quot;#F1E9FF&quot;,\r\n        &quot;x&quot;: 596,\r\n        &quot;y&quot;: 1310,\r\n        &quot;width&quot;: 383,\r\n        &quot;height&quot;: 42\r\n      }\r\n    ]\r\n  }\r\n];\r\n\r\n\/* SD_EDITABLE_DESIGN_V3 *\/\r\nconst DESIGN_COLLAGE_LAYOUTS=[{id:&#039;grid2&#039;,name:&#039;\u53cc\u5217\u7f51\u683c&#039;,kind:&#039;grid&#039;,columns:2},{id:&#039;grid3&#039;,name:&#039;\u4e09\u5217\u7f51\u683c&#039;,kind:&#039;grid&#039;,columns:3},{id:&#039;horizontal&#039;,name:&#039;\u6a2a\u5411\u957f\u56fe&#039;,kind:&#039;horizontal&#039;},{id:&#039;vertical&#039;,name:&#039;\u7eb5\u5411\u957f\u56fe&#039;,kind:&#039;vertical&#039;},{id:&#039;mainLeft&#039;,name:&#039;\u4e3b\u56fe\u5728\u5de6&#039;,kind:&#039;mainLeft&#039;},{id:&#039;mainTop&#039;,name:&#039;\u4e3b\u56fe\u5728\u4e0a&#039;,kind:&#039;mainTop&#039;}];\r\nlet designCollageLayout=&#039;grid2&#039;,designCellId=null,designCollageSyncing=false,designCropGesture=false;\r\nfunction designLayer(raw){return{rotation:0,opacity:1,visible:true,strokeWidth:0,strokeColor:&#039;#ffffff&#039;,shadowBlur:0,shadowColor:&#039;#000000&#039;,shadowOffsetX:0,shadowOffsetY:0,...raw,id:nextId++,name:String(raw.name||(raw.type===&#039;text&#039;?raw.text.slice(0,18):&#039;\u88c5\u9970\u5f62\u72b6&#039;))};}\r\nfunction designLayers(raw){return raw.map(designLayer);}\r\nfunction resetDesignScene(width,height,background,layers,name=&#039;\u672a\u547d\u540d\u8bbe\u8ba1&#039;){\r\n  if(typeof resetProjectIdentity===&#039;function&#039;)resetProjectIdentity(name);releaseCuts();renderCuts();history=[];future=[];hasLoadedExample=false;scene.layers=layers;scene.width=width;scene.height=height;scene.background=background;scene.canvasFixed=true;\r\n  selected=layers.find(l=&gt;l.type===&#039;text&#039;)?.id||layers[0]?.id||null;selection=null;zoomLevel=null;resetAdjust(false);if(typeof normalizeCanvasSelection===&#039;function&#039;)normalizeCanvasSelection();markChanged();renderLayers();syncInspector();draw();\r\n}\r\nasync function applyDesignTemplate(id){\r\n  const template=ORIGINAL_POSTER_TEMPLATES.find(t=&gt;t.id===id);if(!template||busy)return;\r\n  if(!await confirmProjectReplacement())return;\r\n  await run(async()=&gt;{guardSize(template.width,template.height);resetDesignScene(template.width,template.height,template.background,designLayers(template.layers),template.name);setMode(&#039;text&#039;);openProperties();show(&#039;\u5df2\u4f7f\u7528\u201c&#039;+template.name+&#039;\u201d\u3002\u6587\u5b57\u548c\u5f62\u72b6\u5747\u53ef\u7f16\u8f91\uff1b\u70b9\u51fb\u753b\u5e03\u6216\u56fe\u5c42\u5217\u8868\u9009\u62e9\u5185\u5bb9\u3002&#039;);});\r\n}\r\nfunction renderDesignTemplates(){\r\n  const q=$(&#039;designTemplateSearch&#039;).value.trim().toLowerCase(),category=$(&#039;designTemplateCategory&#039;).value,box=$(&#039;designTemplateCards&#039;);box.replaceChildren();\r\n  const matches=ORIGINAL_POSTER_TEMPLATES.filter(t=&gt;(category===&#039;all&#039;||t.category===category)&amp;&amp;(!q||(t.name+&#039; &#039;+t.category).toLowerCase().includes(q)));\r\n  for(const template of matches){const card=document.createElement(&#039;article&#039;);card.className=&#039;design-template-card&#039;;const raw=template.layers.map(l=&gt;({rotation:0,opacity:1,visible:true,strokeWidth:0,...l})),canvas=C.renderScene({...template,layers:raw},{scale:220\/template.width});canvas.setAttribute(&#039;role&#039;,&#039;img&#039;);canvas.setAttribute(&#039;aria-label&#039;,template.name+&#039;\u53ef\u7f16\u8f91\u6d77\u62a5\u9884\u89c8&#039;);const title=document.createElement(&#039;strong&#039;);title.textContent=template.name;const meta=document.createElement(&#039;small&#039;);meta.textContent=template.width+&#039; \u00d7 &#039;+template.height+&#039; \u00b7 &#039;+template.category;const button=document.createElement(&#039;button&#039;);button.type=&#039;button&#039;;button.textContent=&#039;\u4f7f\u7528\u6a21\u677f&#039;;button.addEventListener(&#039;click&#039;,()=&gt;applyDesignTemplate(template.id));card.append(canvas,title,meta,button);box.append(card);}\r\n  $(&#039;designTemplateStatus&#039;).textContent=matches.length?&#039;\u5171 &#039;+matches.length+&#039; \u6b3e\u539f\u521b\u53ef\u7f16\u8f91\u6a21\u677f\u3002&#039;:&#039;\u6ca1\u6709\u627e\u5230\u8be5\u4e3b\u9898\uff0c\u8bd5\u8bd5\u5176\u4ed6\u5173\u952e\u8bcd\u3002&#039;;\r\n}\r\nfunction designTextStyle(kind){\r\n  if(busy)return;let layer=active();if(!layer||layer.type!==&#039;text&#039;){addText();layer=active();}\r\n  if(!layer||layer.type!==&#039;text&#039;||layer.locked){show(&#039;\u8bf7\u5148\u9009\u62e9\u672a\u9501\u5b9a\u7684\u6587\u5b57\u56fe\u5c42\u3002&#039;,true);return;}\r\n  pushHistory();const scale=scene.width\/1080,map={title:{fontSize:78,color:&#039;#17345a&#039;,fontWeight:&#039;bold&#039;,lineHeight:1.14},body:{fontSize:34,color:&#039;#33465e&#039;,fontWeight:&#039;normal&#039;,lineHeight:1.5},label:{fontSize:28,color:&#039;#2468eb&#039;,fontWeight:&#039;bold&#039;,lineHeight:1.2},note:{fontSize:24,color:&#039;#66758a&#039;,fontWeight:&#039;normal&#039;,lineHeight:1.4}};\r\n  Object.assign(layer,map[kind]||map.body);layer.fontSize=Math.max(8,Math.min(500,Math.round(layer.fontSize*scale)));syncInspector();renderLayers();draw();show(&#039;\u5df2\u5e94\u7528\u6587\u5b57\u6837\u5f0f\uff0c\u5f53\u524d\u5b57\u4f53\u4fdd\u7559\u3002&#039;);\r\n}\r\nfunction addDesignTextCombo(kind){\r\n  if(busy)return;const s=scene.width\/1080,w=scene.width*.78,x=scene.width*.11,y=scene.height*.33,groupId=&#039;g_text_&#039;+Date.now().toString(36)+&#039;_&#039;+nextId;\r\n  const text=(value,size,dy,height,color=&#039;#17345a&#039;,weight=&#039;normal&#039;)=&gt;({type:&#039;text&#039;,text:value,x,y:y+dy*s,width:w,height:height*s,fontSize:size*s,fontFamily:&#039;sans-serif&#039;,fontWeight:weight,align:&#039;left&#039;,lineHeight:1.25,color,groupId});\r\n  const combos={heading:[text(&#039;\u628a\u60f3\u6cd5\u53d8\u6210\u4f5c\u54c1&#039;,70,0,100,&#039;#17345a&#039;,&#039;bold&#039;),text(&#039;\u5728\u8fd9\u91cc\u8865\u5145\u4e00\u53e5\u7b80\u77ed\u3001\u6709\u7528\u7684\u4ecb\u7ecd&#039;,30,118,60,&#039;#64748b&#039;)],event:[text(&#039;\u5468\u672b\u521b\u4f5c\u89c1\u9762\u4f1a&#039;,54,0,80,&#039;#17345a&#039;,&#039;bold&#039;),text(&#039;10\u670818\u65e5  \u5468\u65e5  14:00\u201416:00&#039;,30,110,52),text(&#039;\u5730\u70b9\uff1a\u586b\u5199\u6d3b\u52a8\u5730\u5740\\n\u62a5\u540d\uff1a\u586b\u5199\u8054\u7cfb\u65b9\u5f0f&#039;,27,174,90,&#039;#64748b&#039;)],price:[text(&#039;\u00a5 29.9&#039;,100,0,145,&#039;#2468eb&#039;,&#039;bold&#039;),text(&#039;\u5546\u54c1\u540d\u79f0 \/ \u4e00\u53e5\u8bdd\u5356\u70b9&#039;,34,162,58,&#039;#17345a&#039;,&#039;bold&#039;),text(&#039;\u8bf7\u586b\u5199\u5b9e\u9645\u89c4\u683c\u3001\u4ef7\u683c\u4e0e\u670d\u52a1\u8bf4\u660e&#039;,24,239,52,&#039;#64748b&#039;)],quote:[{type:&#039;shape&#039;,shape:&#039;rect&#039;,x:x-24*s,y:y+5*s,width:6*s,height:174*s,color:&#039;#2468eb&#039;,groupId},text(&#039;\u628a\u65f6\u95f4\u7559\u7ed9\u70ed\u7231\uff0c\\n\u628a\u8ba4\u771f\u5199\u8fdb\u6bcf\u4e00\u5929\u3002&#039;,45,0,132,&#039;#17345a&#039;,&#039;bold&#039;),text(&#039;\u2014\u2014 \u5728\u8fd9\u91cc\u586b\u5199\u7f72\u540d&#039;,25,160,50,&#039;#64748b&#039;)]};\r\n  const layers=combos[kind]||combos.heading;if(scene.layers.length+layers.length&gt;50){show(&#039;\u9879\u76ee\u6700\u591a50\u4e2a\u56fe\u5c42\u3002&#039;,true);return;}\r\n  const source=active();if(source?.type===&#039;text&#039;){layers.filter(l=&gt;l.type===&#039;text&#039;).forEach(l=&gt;{l.fontFamily=source.fontFamily;if(source.fontRef)l.fontRef={...source.fontRef};});}\r\n  pushHistory();const added=designLayers(layers);scene.layers.push(...added);selected=added.find(l=&gt;l.type===&#039;text&#039;)?.id||added[0].id;if(typeof normalizeCanvasSelection===&#039;function&#039;)normalizeCanvasSelection();selection=null;setMode(&#039;text&#039;);renderLayers();syncInspector();draw();show(&#039;\u5df2\u6dfb\u52a0\u6587\u5b57\u7ec4\u5408\uff0c\u6bcf\u6bb5\u6587\u5b57\u5747\u53ef\u72ec\u7acb\u7f16\u8f91\u3002&#039;);\r\n}\r\nfunction designCollageFrames(count,width,height,kind,columns,gap,padding){\r\n  if(!Number.isInteger(count)||count&lt;1||count&gt;20)throw Error(&#039;\u8bf7\u6dfb\u52a01\u81f320\u5f20\u53ef\u89c1\u3001\u672a\u9501\u5b9a\u7684\u56fe\u7247\u3002&#039;);\r\n  if(![width,height,gap,padding].every(Number.isFinite)||width&lt;1||height&lt;1||gap&lt;0||padding&lt;0)throw Error(&#039;\u62fc\u56fe\u5c3a\u5bf8\u3001\u95f4\u8ddd\u6216\u7559\u767d\u65e0\u6548\u3002&#039;);\r\n  const innerW=width-padding*2,innerH=height-padding*2;if(innerW&lt;1||innerH&lt;1)throw Error(&#039;\u56db\u5468\u7559\u767d\u8fc7\u5927\uff0c\u8bf7\u51cf\u5c0f\u7559\u767d\u3002&#039;);const cells=[];\r\n  function grid(n,x,y,w,h,cols){const rows=Math.ceil(n\/cols),cw=(w-gap*(cols-1))\/cols,ch=(h-gap*(rows-1))\/rows;if(cw&lt;2||ch&lt;2)throw Error(&#039;\u56fe\u7247\u95f4\u8ddd\u8fc7\u5927\u6216\u683c\u5b50\u592a\u5c0f\uff0c\u8bf7\u589e\u52a0\u753b\u5e03\u5c3a\u5bf8\u3002&#039;);for(let i=0;i&lt;n;i++)cells.push({x:x+(i%cols)*(cw+gap),y:y+Math.floor(i\/cols)*(ch+gap),width:cw,height:ch});}\r\n  if(count===1)grid(1,padding,padding,innerW,innerH,1);\r\n  else if(kind===&#039;mainLeft&#039;){const mainW=(innerW-gap)*.6;cells.push({x:padding,y:padding,width:mainW,height:innerH});grid(count-1,padding+mainW+gap,padding,innerW-mainW-gap,innerH,count&gt;5?2:1);}\r\n  else if(kind===&#039;mainTop&#039;){const mainH=(innerH-gap)*.58;cells.push({x:padding,y:padding,width:innerW,height:mainH});grid(count-1,padding,padding+mainH+gap,innerW,innerH-mainH-gap,Math.min(count-1,count&gt;7?4:3));}\r\n  else grid(count,padding,padding,innerW,innerH,kind===&#039;vertical&#039;?1:kind===&#039;horizontal&#039;?count:Math.max(1,Math.min(count,Math.round(columns)||2)));\r\n  if(cells.some(c=&gt;c.width&lt;2||c.height&lt;2||c.x&lt;0||c.y&lt;0||c.x+c.width&gt;width+.01||c.y+c.height&gt;height+.01))throw Error(&#039;\u62fc\u56fe\u683c\u5b50\u8d85\u51fa\u753b\u5e03\uff0c\u8bf7\u8c03\u6574\u5c3a\u5bf8\u3002&#039;);return cells;\r\n}\r\nfunction collageImages(){return scene.layers.filter(l=&gt;l.type===&#039;image&#039;&amp;&amp;l.visible!==false&amp;&amp;!l.locked);}\r\nfunction designOptionList(select,images,selectedValue,blank){select.replaceChildren();if(blank){const option=document.createElement(&#039;option&#039;);option.value=&#039;&#039;;option.textContent=blank;select.append(option);}for(const [index,l] of images.entries()){const option=document.createElement(&#039;option&#039;);option.value=String(l.id);option.textContent=(index+1)+&#039;. &#039;+l.name;select.append(option);}if(images.some(l=&gt;String(l.id)===String(selectedValue)))select.value=String(selectedValue);}\r\nfunction syncDesignCollage(){\r\n  if(designCollageSyncing||!$(&#039;collageCellSelect&#039;))return;designCollageSyncing=true;\r\n  try{const images=collageImages(),frames=scene.layers.filter(l=&gt;l.type===&#039;image&#039;&amp;&amp;l.frameCrop),current=active();if(current?.type===&#039;image&#039;&amp;&amp;current.frameCrop)designCellId=current.id;if(!frames.some(l=&gt;l.id===designCellId))designCellId=frames[0]?.id||null;\r\n    const main=$(&#039;collageMainImage&#039;).value;designOptionList($(&#039;collageMainImage&#039;),images,main);designOptionList($(&#039;collageCellSelect&#039;),frames,designCellId,&#039;\u9009\u62e9\u62fc\u56fe\u683c\u5b50&#039;);const replacements=scene.layers.filter(l=&gt;l.type===&#039;image&#039;&amp;&amp;l.id!==designCellId);designOptionList($(&#039;collageReplacement&#039;),replacements,$(&#039;collageReplacement&#039;).value,&#039;\u9009\u62e9\u66ff\u6362\u56fe\u7247&#039;);\r\n    const layer=frames.find(l=&gt;l.id===designCellId),enabled=!!layer&amp;&amp;!layer.locked;[&#039;collageFit&#039;,&#039;collageOffsetX&#039;,&#039;collageOffsetY&#039;,&#039;collageZoom&#039;,&#039;collageCellReset&#039;,&#039;collageDetach&#039;,&#039;collageReplace&#039;].forEach(id=&gt;$(id).disabled=!enabled);\r\n    if(layer){$(&#039;collageFit&#039;).value=layer.frameCrop.fit||&#039;cover&#039;;$(&#039;collageOffsetX&#039;).value=Math.round((layer.frameCrop.offsetX??.5)*100);$(&#039;collageOffsetY&#039;).value=Math.round((layer.frameCrop.offsetY??.5)*100);$(&#039;collageZoom&#039;).value=Math.round((layer.frameCrop.zoom||1)*100);}\r\n    $(&#039;collageLayoutInfo&#039;).textContent=images.length?&#039;\u5c06\u6392\u7248 &#039;+images.length+&#039; \u5f20\u56fe\u7247\uff1b\u6587\u5b57\u4e0e\u5f62\u72b6\u4fdd\u7559\u5728\u539f\u4f4d\u7f6e\u3002&#039;:&#039;\u5148\u6dfb\u52a0\u56fe\u7247\uff0c\u518d\u9009\u62e9\u62fc\u56fe\u7248\u5f0f\u3002&#039;;$(&#039;collage&#039;).disabled=!images.length;\r\n  }finally{designCollageSyncing=false;}\r\n}\r\nfunction pickDesignCollage(id){const layout=DESIGN_COLLAGE_LAYOUTS.find(l=&gt;l.id===id);if(!layout)return;designCollageLayout=id;if(layout.columns)$(&#039;collageCols&#039;).value=layout.columns;$(&#039;collageCols&#039;).disabled=layout.kind!==&#039;grid&#039;;document.querySelectorAll(&#039;[data-design-layout]&#039;).forEach(b=&gt;{b.classList.toggle(&#039;active&#039;,b.dataset.designLayout===id);b.setAttribute(&#039;aria-pressed&#039;,String(b.dataset.designLayout===id));});\r\n  const count=Math.max(2,collageImages().length),gap=Number($(&#039;collageGap&#039;).value)||20,pad=Number($(&#039;collagePadding&#039;).value)||40;\r\n  if(layout.kind===&#039;vertical&#039;||layout.kind===&#039;horizontal&#039;){const cell=Math.max(40,Math.min(960,Math.floor((7800-2*pad-gap*(count-1))\/count))),short=cell+2*pad,long=cell*count+gap*(count-1)+2*pad;$(&#039;collageWidth&#039;).value=layout.kind===&#039;vertical&#039;?short:long;$(&#039;collageHeight&#039;).value=layout.kind===&#039;vertical&#039;?long:short;}\r\n}\r\nfunction collage(){try{\r\n  if(busy)return;let images=collageImages();if(!images.length)throw Error(&#039;\u8bf7\u5148\u6dfb\u52a0\u53ef\u89c1\u4e14\u672a\u9501\u5b9a\u7684\u56fe\u7247\u3002&#039;);const size=guardSize($(&#039;collageWidth&#039;).value,$(&#039;collageHeight&#039;).value),gap=Math.max(0,Math.min(200,Number($(&#039;collageGap&#039;).value)||0)),padding=Math.max(0,Math.min(300,Number($(&#039;collagePadding&#039;).value)||0)),radius=Math.max(0,Math.min(200,Number($(&#039;collageRadius&#039;).value)||0)),layout=DESIGN_COLLAGE_LAYOUTS.find(l=&gt;l.id===designCollageLayout)||DESIGN_COLLAGE_LAYOUTS[0],main=Number($(&#039;collageMainImage&#039;).value);\r\n  if([&#039;mainLeft&#039;,&#039;mainTop&#039;].includes(layout.kind)&amp;&amp;images.some(l=&gt;l.id===main))images=[images.find(l=&gt;l.id===main),...images.filter(l=&gt;l.id!==main)];\r\n  const frames=designCollageFrames(images.length,size.w,size.h,layout.kind,Number($(&#039;collageCols&#039;).value),gap,padding);pushHistory();scene.width=size.w;scene.height=size.h;scene.canvasFixed=true;scene.background=$(&#039;collageTransparent&#039;).checked?null:$(&#039;collageBg&#039;).value;\r\n  images.forEach((l,i)=&gt;{Object.assign(l,frames[i],{rotation:0,frameCrop:{fit:&#039;cover&#039;,offsetX:.5,offsetY:.5,zoom:1,radius}});});selected=images[0].id;designCellId=selected;selection=null;zoomLevel=null;resetAdjust(false);if(typeof normalizeCanvasSelection===&#039;function&#039;)normalizeCanvasSelection();syncInspector();renderLayers();draw();show(&#039;\u62fc\u56fe\u5df2\u6392\u597d\u3002\u6bcf\u4e00\u683c\u4ecd\u662f\u53ef\u7f16\u8f91\u56fe\u7247\uff0c\u539f\u56fe\u4fdd\u7559\uff1b\u53ef\u5728\u4e0b\u65b9\u8c03\u6574\u683c\u5185\u4f4d\u7f6e\u6216\u66ff\u6362\u56fe\u7247\u3002&#039;);\r\n}catch(error){show(error.message||String(error),true);}}\r\nfunction updateCollageCell(reset=false,record=true){const layer=scene.layers.find(l=&gt;l.id===designCellId);if(!layer?.frameCrop||layer.locked||busy)return;if(record)pushHistory();else markChanged();layer.frameCrop={...layer.frameCrop,...(reset?{fit:&#039;cover&#039;,offsetX:.5,offsetY:.5,zoom:1}:{fit:$(&#039;collageFit&#039;).value,offsetX:Number($(&#039;collageOffsetX&#039;).value)\/100,offsetY:Number($(&#039;collageOffsetY&#039;).value)\/100,zoom:Number($(&#039;collageZoom&#039;).value)\/100})};syncInspector();draw();}\r\nfunction detachCollageCell(){const layer=scene.layers.find(l=&gt;l.id===designCellId);if(!layer?.frameCrop||layer.locked||busy)return;pushHistory();delete layer.frameCrop;const ratio=Math.min(layer.width\/layer.image.width,layer.height\/layer.image.height),w=layer.image.width*ratio,h=layer.image.height*ratio;layer.x+=(layer.width-w)\/2;layer.y+=(layer.height-h)\/2;layer.width=w;layer.height=h;syncInspector();renderLayers();draw();show(&#039;\u5df2\u89e3\u9664\u683c\u5b50\u88c1\u5207\uff0c\u5b8c\u6574\u56fe\u7247\u6309\u6bd4\u4f8b\u663e\u793a\u3002&#039;);}\r\nfunction replaceCollageCell(){const layer=scene.layers.find(l=&gt;l.id===designCellId),replacement=scene.layers.find(l=&gt;l.id===Number($(&#039;collageReplacement&#039;).value));if(!layer?.frameCrop||layer.locked||!replacement||replacement.type!==&#039;image&#039;||layer===replacement||busy)return;try{if(pixelCount()-layer.image.width*layer.image.height+replacement.image.width*replacement.image.height&gt;MAX_ASSET_PIXELS)throw Error(&#039;\u66ff\u6362\u540e\u56fe\u7247\u50cf\u7d20\u8d85\u51fa\u4e0a\u9650\uff0c\u8bf7\u7f29\u5c0f\u56fe\u7247\u540e\u91cd\u8bd5\u3002&#039;);const originalPixels=scene.layers.filter(l=&gt;l.type===&#039;image&#039;).reduce((total,l)=&gt;total+(l.original||l.image).width*(l.original||l.image).height,0),previousOriginal=layer.original||layer.image,nextOriginal=replacement.original||replacement.image;if(originalPixels-previousOriginal.width*previousOriginal.height+nextOriginal.width*nextOriginal.height&gt;MAX_ASSET_PIXELS)throw Error(&#039;\u66ff\u6362\u540e\u4fdd\u7559\u539f\u56fe\u7684\u603b\u50cf\u7d20\u8d85\u51fa\u4e0a\u9650\uff0c\u8bf7\u5148\u51cf\u5c11\u56fe\u7247\u3002&#039;);const image=cloneCanvas(replacement.image),baseline=cloneCanvas(replacement.baseline||replacement.image),original=cloneCanvas(replacement.original||replacement.image);pushHistory();layer.image=image;layer.canvas=image;layer.baseline=baseline;layer.original=original;layer.name=replacement.name;layer.frameCrop={...layer.frameCrop,offsetX:.5,offsetY:.5,zoom:1};selected=layer.id;resetAdjust(false);syncInspector();renderLayers();draw();show(&#039;\u5f53\u524d\u683c\u5b50\u5df2\u66ff\u6362\uff0c\u6765\u6e90\u56fe\u7247\u4e0e\u5176\u4ed6\u56fe\u5c42\u4fdd\u6301\u4e0d\u53d8\u3002&#039;);}catch(error){show(error.message,true);}}\r\nfunction initDesignWorkspace(){\r\n  for(const category of new Set(ORIGINAL_POSTER_TEMPLATES.map(t=&gt;t.category))){const option=document.createElement(&#039;option&#039;);option.value=category;option.textContent=category;$(&#039;designTemplateCategory&#039;).append(option);}renderDesignTemplates();\r\n  $(&#039;designTemplateSearch&#039;).addEventListener(&#039;input&#039;,renderDesignTemplates);$(&#039;designTemplateCategory&#039;).addEventListener(&#039;change&#039;,renderDesignTemplates);on(&#039;designBlank&#039;,()=&gt;$(&#039;newCanvasDialog&#039;).showModal());\r\n  for(const layout of DESIGN_COLLAGE_LAYOUTS){const button=document.createElement(&#039;button&#039;);button.type=&#039;button&#039;;button.dataset.designLayout=layout.id;button.setAttribute(&#039;aria-pressed&#039;,String(layout.id===designCollageLayout));if(layout.id===designCollageLayout)button.className=&#039;active&#039;;const canvas=document.createElement(&#039;canvas&#039;);canvas.width=108;canvas.height=76;const ctx=canvas.getContext(&#039;2d&#039;);ctx.fillStyle=&#039;#f1f5fa&#039;;ctx.fillRect(0,0,108,76);const cells=designCollageFrames(layout.kind===&#039;grid&#039;?6:4,108,76,layout.kind,layout.columns||2,3,5);cells.forEach((cell,i)=&gt;{ctx.fillStyle=i===0?&#039;#3876de&#039;:&#039;#abc9ed&#039;;ctx.fillRect(cell.x,cell.y,cell.width,cell.height);});const name=document.createElement(&#039;span&#039;);name.textContent=layout.name;button.append(canvas,name);button.addEventListener(&#039;click&#039;,()=&gt;pickDesignCollage(layout.id));$(&#039;collageLayouts&#039;).append(button);}\r\n  document.querySelectorAll(&#039;[data-design-text-style]&#039;).forEach(button=&gt;button.addEventListener(&#039;click&#039;,()=&gt;designTextStyle(button.dataset.designTextStyle)));document.querySelectorAll(&#039;[data-design-text-combo]&#039;).forEach(button=&gt;button.addEventListener(&#039;click&#039;,()=&gt;addDesignTextCombo(button.dataset.designTextCombo)));\r\n  $(&#039;collageCellSelect&#039;).addEventListener(&#039;change&#039;,()=&gt;{designCellId=Number($(&#039;collageCellSelect&#039;).value)||null;if(designCellId)setCanvasSelection([designCellId],designCellId,false);syncDesignCollage();});$(&#039;collageFit&#039;).addEventListener(&#039;change&#039;,()=&gt;updateCollageCell());[&#039;collageOffsetX&#039;,&#039;collageOffsetY&#039;,&#039;collageZoom&#039;].forEach(id=&gt;{$(id).addEventListener(&#039;input&#039;,()=&gt;{if(!designCropGesture){const layer=scene.layers.find(l=&gt;l.id===designCellId);if(!layer?.frameCrop||layer.locked||busy)return;pushHistory();designCropGesture=true;}updateCollageCell(false,false);});[&#039;change&#039;,&#039;blur&#039;].forEach(event=&gt;$(id).addEventListener(event,()=&gt;{designCropGesture=false;}));});on(&#039;collageCellReset&#039;,()=&gt;updateCollageCell(true));on(&#039;collageDetach&#039;,detachCollageCell);on(&#039;collageReplace&#039;,replaceCollageCell);on(&#039;collageImport&#039;,()=&gt;requestLocalPicker(&#039;images&#039;));\r\n  const originalSync=syncInspector;syncInspector=function(){originalSync();syncDesignCollage();};\r\n  const originalMode=setMode;setMode=function(value){originalMode(value);$(&#039;designTextPresets&#039;).hidden=value!==&#039;text&#039;;$(&#039;templatePanel&#039;).hidden=value!==&#039;templates&#039;;if(value===&#039;templates&#039;){$(&#039;modeTitle&#039;).textContent=&#039;\u6d77\u62a5\u6a21\u677f&#039;;$(&#039;propertyTitle&#039;).textContent=&#039;\u6d77\u62a5\u6a21\u677f&#039;;$(&#039;toolHint&#039;).textContent=&#039;\u9009\u7528\u539f\u521b\u6a21\u677f\uff0c\u6216\u4ece\u7a7a\u767d\u5f00\u59cb\u3002\u6a21\u677f\u4e2d\u7684\u6587\u5b57\u4e0e\u5f62\u72b6\u5747\u53ef\u72ec\u7acb\u7f16\u8f91\u3002&#039;;}if(value===&#039;collage&#039;){$(&#039;collageWidth&#039;).value=scene.width;$(&#039;collageHeight&#039;).value=scene.height;$(&#039;collageBg&#039;).value=scene.background||&#039;#ffffff&#039;;$(&#039;collageTransparent&#039;).checked=scene.background===null;syncDesignCollage();}};\r\n}\r\n\r\ninitDesignWorkspace();syncInspector();renderLayers();renderCuts();setMode(&#039;edit&#039;);updateHistory();draw();initUpgrade();\r\n})();\r\n&lt;\/script&gt;&lt;script&gt;(function(){let scheduled=false;function report(){if(scheduled)return;scheduled=true;requestAnimationFrame(()=&gt;{scheduled=false;parent.postMessage({type:&quot;sd:image-workspace-height&quot;,height:Math.ceil(document.body.getBoundingClientRect().height)},&quot;*&quot;);});}if(window.ResizeObserver)new ResizeObserver(report).observe(document.body);window.addEventListener(&quot;resize&quot;,report);window.addEventListener(&quot;load&quot;,report);report();})();&lt;\/script&gt;&lt;\/body&gt;&lt;\/html&gt;\"><\/iframe><div id=\"sd-image-workspace-1-host\" class=\"sd-image-workspace-local-import\"><style>\/* SHANDE_FOCUS_HOST_V3 *\/.sd-image-workspace-host.sd-image-focus{position:fixed!important;inset:var(--sd-focus-top,0px) 0 auto!important;z-index:2147483000!important;display:flex!important;flex-direction:column!important;width:100%!important;max-width:none!important;height:var(--sd-focus-height,100dvh)!important;margin:0!important;padding:0!important;background:#eef1f5;box-sizing:border-box;overflow:hidden;isolation:isolate}.sd-image-workspace-host.sd-image-focus>iframe{display:block!important;flex:1 1 0!important;width:100%!important;height:0!important;min-height:0!important;max-height:none!important;border-radius:0!important}.sd-image-workspace-host.sd-image-focus>.sd-image-workspace-local-import{flex:0 0 auto;margin:0;padding:0 10px;background:#fff;border-top:1px solid #e3e8ef;max-height:120px;overflow:auto}.sd-image-workspace-host.sd-image-focus>.sd-image-workspace-local-import>details{display:block;border:0;border-radius:0;padding:3px 0;background:transparent}.sd-image-workspace-host.sd-image-focus>.sd-image-workspace-local-import>details>summary{font-size:11px;line-height:24px}.sd-image-workspace-host.sd-image-focus>.sd-image-workspace-local-import>[data-sd-host-status]{margin:4px 0;font-size:11px}.sd-image-workspace-host.sd-image-focus>.sd-image-workspace-local-import>[data-sd-host-downloads]{padding:5px 8px;border-radius:0;max-height:76px}.sd-image-workspace-host.sd-image-focus>.sd-image-workspace-context,.sd-image-workspace-host.sd-image-focus>.sd-image-workspace-license{display:none}.sd-image-workspace-local-import>[data-sd-focus-close]{display:none}.sd-image-workspace-host.sd-image-focus>.sd-image-workspace-local-import>[data-sd-focus-close]{display:inline-flex;float:right;min-height:26px;padding:2px 7px;margin:2px 0;border:0;background:transparent;color:#65748b;font-size:11px}.sd-image-workspace-local-import{font:12px\/1.7 system-ui;color:#58677c;margin:0 0 10px}.sd-image-workspace-local-import details{border:1px solid #e5e9f0;border-radius:10px;background:#fff;padding:9px 12px}.sd-image-workspace-local-import summary{cursor:pointer}.sd-image-host-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:9px}.sd-image-workspace-local-import button,.sd-image-workspace-local-import select,.sd-image-workspace-local-import input{font:inherit;min-height:38px;padding:8px 12px;border:1px solid #dfe5ee;border-radius:8px;background:#fff;color:#263852}.sd-image-workspace-local-import button{cursor:pointer}.sd-image-workspace-local-import button:disabled{opacity:.5;cursor:default}.sd-image-workspace-local-import [data-sd-host-downloads]{padding:10px 12px;background:#eef4ff;max-height:150px;overflow:auto;border-radius:8px}.sd-image-workspace-local-import [data-sd-catalog]{width:min(920px,calc(100vw - 24px));max-height:85vh;overflow:auto;border:1px solid #dce4ef;padding:20px;border-radius:16px;color:#263852;background:#f8faff}.sd-image-workspace-local-import [data-sd-catalog]::backdrop{background:#10182888}.sd-image-catalog-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.sd-image-catalog-heading h2{margin:0;font-size:21px}.sd-image-workspace-local-import [data-sd-catalog-form]{display:flex;gap:8px;flex-wrap:wrap;margin:15px 0}.sd-image-workspace-local-import [data-sd-catalog-q]{flex:1;min-width:150px}.sd-image-workspace-local-import [data-sd-catalog-grid]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.sd-image-asset-card{display:flex;flex-direction:column;gap:7px;padding:10px;border:1px solid #e3e9f1;border-radius:10px;background:white;min-width:0}.sd-image-asset-card img{width:100%;height:120px;object-fit:contain;background:#f1f4f8}.sd-image-asset-card strong{font-size:12px;line-height:1.6;overflow-wrap:anywhere}.sd-image-asset-card a{font-size:11px;color:#2468eb}.sd-image-asset-card select{width:100%;font-size:11px}.sd-image-asset-card button{margin-top:auto;background:#eef4ff;color:#2468eb}.sd-image-catalog-pages{display:flex;justify-content:center;gap:12px;margin-top:16px}@media(max-width:600px){.sd-image-workspace-local-import [data-sd-catalog]{padding:13px}.sd-image-workspace-local-import [data-sd-catalog-grid]{grid-template-columns:repeat(2,minmax(0,1fr))}.sd-image-asset-card img{height:100px}}<\/style><button type=\"button\" data-sd-focus-close aria-label=\"\u9000\u51fa\u5de5\u4f5c\u53f0\u4e13\u6ce8\u6a21\u5f0f\">\u9000\u51fa\u4e13\u6ce8 \u00b7 Esc<\/button><details><summary>\u672c\u673a\u6587\u4ef6\u4e0e\u4e0b\u8f7d\u8bb0\u5f55<\/summary><div class=\"sd-image-host-actions\"><button type=\"button\" data-sd-host-pick=\"images\">\u672c\u673a\u6dfb\u52a0\u56fe\u7247<\/button><button type=\"button\" data-sd-host-pick=\"project\">\u6253\u5f00\u672c\u673a\u9879\u76ee<\/button><button type=\"button\" data-sd-member-link>\u67e5\u770b\u4f1a\u5458\u6743\u76ca<\/button><\/div><\/details><input data-sd-host-input=\"images\" type=\"file\" accept=\"image\/png,image\/jpeg,image\/webp\" multiple hidden><input data-sd-host-input=\"project\" type=\"file\" accept=\".json,application\/json\" hidden><p data-sd-host-status role=\"status\" aria-live=\"polite\" hidden><\/p><div data-sd-host-downloads hidden><\/div><dialog data-sd-catalog aria-label=\"\u672c\u7ad9\u7d20\u6750\"><div class=\"sd-image-catalog-heading\"><h2>\u4ece\u672c\u7ad9\u7d20\u6750\u5e93\u83b7\u5f97\u7075\u611f<\/h2><button type=\"button\" data-sd-catalog-close aria-label=\"\u5173\u95ed\u7d20\u6750\u5e93\">\u00d7<\/button><\/div><p>\u641c\u7d22\u3001\u9009\u597d\u6388\u6743\uff0c\u539f\u56fe\u76f4\u63a5\u63d2\u5165\u3002\u521b\u4f5c\u4f1a\u5458\u4e0d\u4ee3\u66ff\u5546\u54c1\u672c\u8eab\u7684\u6388\u6743\u3002<\/p><form data-sd-catalog-form><input data-sd-catalog-q type=\"search\" placeholder=\"\u641c\u7d22\u56fe\u7247\u3001\u56fe\u6848\u3001\u88c5\u9970\u5143\u7d20\" aria-label=\"\u7d20\u6750\u5173\u952e\u8bcd\" maxlength=\"100\"><select data-sd-catalog-scope aria-label=\"\u7d20\u6750\u8303\u56f4\"><option value=\"all\">\u5168\u90e8\u7d20\u6750<\/option><option value=\"free\">\u514d\u8d39\u7d20\u6750<\/option><option value=\"purchased\">\u5df2\u8d2d\u7d20\u6750<\/option><option value=\"favorites\">\u6211\u7684\u6536\u85cf<\/option><\/select><button type=\"submit\" data-sd-catalog-search>\u641c\u7d22\u7d20\u6750<\/button><\/form><p data-sd-catalog-status role=\"status\" aria-live=\"polite\"><\/p><div data-sd-catalog-grid><\/div><div class=\"sd-image-catalog-pages\"><button type=\"button\" data-sd-catalog-prev>\u4e0a\u4e00\u9875<\/button><button type=\"button\" data-sd-catalog-next>\u4e0b\u4e00\u9875<\/button><\/div><\/dialog><\/div><p class=\"sd-image-workspace-context\" style=\"margin:0 0 8px;font-size:12px;line-height:1.7;color:#58677c;\"><a href=\"https:\/\/www.zipget.cn\/en\/\">\u8fd4\u56de\u95ea\u5f97\u7d20\u6750\u7ad9<\/a><\/p><script>(function(){\r\n  const frame=document.getElementById(\"sd-image-workspace-1\"),host=document.getElementById(\"sd-image-workspace-1\"+\"-host\");\r\n  if(!frame||!host)return;\r\n  const imageInput=host.querySelector(\"[data-sd-host-input=images]\"),projectInput=host.querySelector(\"[data-sd-host-input=project]\"),status=host.querySelector(\"[data-sd-host-status]\"),downloadBox=host.querySelector(\"[data-sd-host-downloads]\"),buttons=Array.from(host.querySelectorAll(\"[data-sd-host-pick]\"));\r\n  let ready=false,pending=null,serial=0,processing=false,generation=0,downloadRecords=[],dirty=false;\r\n  const seenDownloads=new Set();\r\n  window.addEventListener(\"beforeunload\",event=>{if(dirty){event.preventDefault();event.returnValue=\"\";}});\r\n  let viewportQueued=false,lastViewport=\"\";\r\n  \/\/ BEGIN SHANDE_FOCUS_HOST_V3: preserve the iframe node and its in-memory project.\r\n  const focusShell=frame.closest('.sd-image-workspace-host');\r\n  let workspaceFocused=false,focusSaved=null;\r\n  function updateFocusBox(){if(!workspaceFocused||!focusShell)return;const viewport=window.visualViewport;focusShell.style.setProperty('--sd-focus-height',Math.round(Math.max(240,Math.min(6000,Number(viewport?.height||window.innerHeight))))+'px');focusShell.style.setProperty('--sd-focus-top',Math.round(Math.max(0,Number(viewport?.offsetTop||0)))+'px');}\r\n  function setWorkspaceFocus(enabled){\r\n    if(!focusShell)throw Error('\u5f53\u524d\u9875\u9762\u6682\u4e0d\u652f\u6301\u4e13\u6ce8\u6a21\u5f0f\u3002');const next=enabled===true;\r\n    if(next!==workspaceFocused){\r\n      if(next){\r\n        focusSaved={x:window.scrollX,y:window.scrollY,frameHeight:frame.style.height,rootOverflow:document.documentElement.style.getPropertyValue('overflow'),rootPriority:document.documentElement.style.getPropertyPriority('overflow'),bodyOverflow:document.body.style.getPropertyValue('overflow'),bodyPriority:document.body.style.getPropertyPriority('overflow')};\r\n        workspaceFocused=true;focusShell.classList.add('sd-image-focus');document.documentElement.style.setProperty('overflow','hidden');document.body.style.setProperty('overflow','hidden');updateFocusBox();\r\n      }else{\r\n        workspaceFocused=false;focusShell.classList.remove('sd-image-focus');focusShell.style.removeProperty('--sd-focus-height');focusShell.style.removeProperty('--sd-focus-top');\r\n        if(focusSaved){for(const [node,value,priority] of [[document.documentElement,focusSaved.rootOverflow,focusSaved.rootPriority],[document.body,focusSaved.bodyOverflow,focusSaved.bodyPriority]]){if(value)node.style.setProperty('overflow',value,priority);else node.style.removeProperty('overflow');}frame.style.height=focusSaved.frameHeight;window.scrollTo(focusSaved.x,focusSaved.y);focusSaved=null;}\r\n      }\r\n    }\r\n    send({type:'sd:image-workspace-host-focus',enabled:workspaceFocused});lastViewport='';reportViewport();return {enabled:workspaceFocused};\r\n  }\r\n  host.querySelector('[data-sd-focus-close]')?.addEventListener('click',()=>setWorkspaceFocus(false));\r\n  document.addEventListener('keydown',event=>{if(event.key==='Escape'&&workspaceFocused&&!host.querySelector('dialog[open]')){event.preventDefault();setWorkspaceFocus(false);}});\r\n  \/\/ END SHANDE_FOCUS_HOST_V3\r\n\r\n  function reportViewport(){\r\n    if(viewportQueued||typeof frame.getBoundingClientRect!==\"function\"||typeof window.requestAnimationFrame!==\"function\")return;\r\n    viewportQueued=true;\r\n    window.requestAnimationFrame(()=>{\r\n      viewportQueued=false;\r\n      updateFocusBox();\r\n      const rect=frame.getBoundingClientRect(),hostHeight=Number(window.visualViewport?.height||window.innerHeight),hostTop=Number(window.visualViewport?.offsetTop||0);\r\n      if(!Number.isFinite(rect.height)||!Number.isFinite(rect.top)||!Number.isFinite(hostHeight)||!Number.isFinite(hostTop)||rect.height<=0||hostHeight<=0)return;\r\n      const height=Math.min(6000,Math.max(0,rect.height)),top=Math.min(height,Math.max(0,hostTop-rect.top)),bottom=Math.min(height,Math.max(top,hostTop+Math.min(6000,hostHeight)-rect.top));\r\n      const viewport={top:Math.round(top),bottom:Math.round(bottom),height:Math.round(height),focus:workspaceFocused},signature=JSON.stringify(viewport)+\":\"+generation;\r\n      if(signature===lastViewport)return;lastViewport=signature;\r\n      send({type:\"sd:image-workspace-host-viewport\",...viewport});\r\n    });\r\n  }\r\n  window.addEventListener(\"resize\",reportViewport,{passive:true});\r\n  window.addEventListener(\"scroll\",reportViewport,{passive:true,capture:true});\r\n  if(window.visualViewport){window.visualViewport.addEventListener(\"resize\",reportViewport,{passive:true});window.visualViewport.addEventListener(\"scroll\",reportViewport,{passive:true});}\r\n  function message(text){status.hidden=!text;status.textContent=text||\"\";}\r\n  function send(data){if(frame.contentWindow)frame.contentWindow.postMessage({...data,protocol:1,generation},\"*\");}\r\n  function setBusy(value){processing=!!value;buttons.forEach(button=>button.disabled=processing);}\r\n  function deliver(){if(!pending||pending.sent||!ready||processing)return;pending.sent=true;send({type:\"sd:image-workspace-host-files\",requestId:pending.requestId,kind:pending.kind,files:pending.files});}\r\n  function choose(kind){if(currentBoot.capabilities?.import!==true){message(\"\u8bf7\u5148\u514d\u8d39\u6ce8\u518c\u6216\u767b\u5f55\uff0c\u5373\u53ef\u5bfc\u5165\u81ea\u5df1\u7684\u6587\u4ef6\u3002\u5de5\u4f5c\u53f0\u5185\u7684\u793a\u4f8b\u53ef\u76f4\u63a5\u8bd5\u7528\u3002\");return;}if(processing){message(\"\u5de5\u4f5c\u53f0\u6b63\u5728\u5904\u7406\uff0c\u8bf7\u7a0d\u540e\u518d\u9009\u62e9\u6587\u4ef6\u3002\");return;}const input=kind===\"images\"?imageInput:kind===\"project\"?projectInput:null;if(!input)return;input.value=\"\";input.click();}\r\n  async function receiveDownload(data){\r\n    const reply=(ok,text=\"\")=>send({type:\"sd:image-workspace-host-download-result\",requestId:data.requestId,ok,message:text});\r\n    try{await requireDownloadPermission(data.blob);}catch(error){message(error.message);reply(false,error.message);return;}\r\n    if(!Number.isSafeInteger(data.requestId)||data.requestId<1||seenDownloads.has(data.requestId))return;\r\n    const blob=data.blob;\r\n    if(!(blob instanceof Blob)||!Number.isFinite(blob.size)||blob.size>100000000||!blob.size){message(\"\u4e0b\u8f7d\u6587\u4ef6\u65e0\u6548\u6216\u8d85\u8fc7100MB\uff0c\u8bf7\u51cf\u5c0f\u56fe\u7247\u5c3a\u5bf8\u540e\u91cd\u8bd5\u3002\");reply(false,\"\u4e0b\u8f7d\u6587\u4ef6\u65e0\u6548\u6216\u8d85\u8fc7100MB\u3002\");return;}\r\n    const extensions={\"image\/png\":\"png\",\"image\/jpeg\":\"jpg\",\"image\/webp\":\"webp\",\"image\/svg+xml\":\"svg\",\"application\/zip\":\"zip\",\"application\/json\":\"json\"};\r\n    let extension=extensions[String(blob.type||\"\").toLowerCase()];\r\n    if(!extension&&blob.type===\"application\/octet-stream\"&&typeof data.name===\"string\"&&\/\\.zip$\/i.test(data.name))extension=\"zip\";\r\n    if(!extension){message(\"\u8be5\u6587\u4ef6\u7c7b\u578b\u4e0d\u80fd\u4ece\u56fe\u7247\u5de5\u4f5c\u53f0\u4e0b\u8f7d\u3002\");reply(false,\"\u9879\u76ee\u6587\u4ef6\u7c7b\u578b\u65e0\u6548\u3002\");return;}\r\n    let name=String(data.name||\"\u56fe\u7247\").normalize(\"NFC\").replace(\/[\\u0000-\\u001f\\u007f<>:\\\"\/\\\\|?*]\/g,\"_\").replace(\/^\\.+|[.\\s]+$\/g,\"\").trim();\r\n    name=Array.from(name||\"\u56fe\u7247\").slice(0,120).join(\"\").replace(\/\\.(?:png|jpe?g|webp|svg|zip|json)$\/i,\"\");\r\n    if(\/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\.|$)\/i.test(name))name=\"_\"+name;\r\n    name+=\".\"+extension;\r\n    seenDownloads.add(data.requestId);while(seenDownloads.size>40)seenDownloads.delete(seenDownloads.values().next().value);\r\n    const url=URL.createObjectURL(blob),record={url,name,size:blob.size};downloadRecords.unshift(record);\r\n    while(downloadRecords.length>5||downloadRecords.reduce((total,item)=>total+item.size,0)>200000000)URL.revokeObjectURL(downloadRecords.pop().url);\r\n    downloadBox.hidden=false;downloadBox.replaceChildren();\r\n    const title=document.createElement(\"p\");title.textContent=\"\u4e0b\u8f7d\u6587\u4ef6\u5df2\u51c6\u5907\u597d\uff1b\u5982\u672a\u81ea\u52a8\u4e0b\u8f7d\uff0c\u8bf7\u70b9\u51fb\u4e0b\u9762\u7684\u518d\u6b21\u4e0b\u8f7d\u94fe\u63a5\u3002\";downloadBox.append(title);\r\n    downloadRecords.forEach(item=>{const link=document.createElement(\"a\");link.href=item.url;link.download=item.name;link.textContent=\"\u518d\u6b21\u4e0b\u8f7d\uff1a\"+item.name;link.style.display=\"block\";link.style.margin=\"6px 0\";downloadBox.append(link);});\r\n    downloadBox.querySelector(\"a\").click();reply(true);\r\n  }\r\n    \/\/ Runs in the real same-origin parent, not inside the opaque editor sandbox.\r\n  const creativeConfig={\"boot\":{\"mode\":\"trial\",\"status\":\"guest\",\"expiresAt\":0,\"canCreate\":false,\"canRetrieve\":false,\"capabilities\":{\"demoEdit\":true,\"basicEdit\":false,\"import\":false,\"basicExport\":false,\"localDraft\":false,\"advancedExport\":false,\"cloudSave\":false,\"siteAssets\":false,\"catalogBrowse\":true,\"advancedEdit\":false,\"retrieve\":false},\"tool\":\"image\",\"brand\":{\"logoUrl\":\"https:\\\/\\\/www.zipget.cn\\\/wp-content\\\/themes\\\/astra-child\\\/assets\\\/creative\\\/20261003-v14\\\/brand\\\/shande-full-logo.png\",\"siteUrl\":\"https:\\\/\\\/www.zipget.cn\\\/en\\\/\",\"name\":\"\\u95ea\\u5f97\\u7d20\\u6750\"},\"siteUrl\":\"https:\\\/\\\/www.zipget.cn\\\/en\\\/\",\"membershipUrl\":\"https:\\\/\\\/www.zipget.cn\\\/%e4%bc%9a%e5%91%98%e4%b8%ad%e5%bf%83\\\/\",\"loginUrl\":\"https:\\\/\\\/www.zipget.cn\\\/en\\\/?shande_auth=login\",\"statusUrl\":\"https:\\\/\\\/www.zipget.cn\\\/en\\\/wp-json\\\/shande-creative\\\/v1\\\/status?tool=image\",\"apiBase\":\"https:\\\/\\\/www.zipget.cn\\\/en\\\/wp-json\\\/shande-pptist\\\/v1\",\"sourceUrl\":\"https:\\\/\\\/www.zipget.cn\\\/wp-content\\\/themes\\\/astra-child\\\/assets\\\/creative\\\/20261009-v4-materials\\\/CreativeSuite-source.zip\",\"draftScope\":\"guest\",\"toolUrls\":{\"ppt\":\"https:\\\/\\\/www.zipget.cn\\\/en\\\/ppt-workspace\\\/\",\"image\":\"https:\\\/\\\/www.zipget.cn\\\/image-workspace\\\/\",\"word\":\"https:\\\/\\\/www.zipget.cn\\\/en\\\/word-workspace\\\/\",\"sheet\":\"https:\\\/\\\/www.zipget.cn\\\/en\\\/excel-workspace\\\/\",\"audio\":\"https:\\\/\\\/www.zipget.cn\\\/en\\\/audio-workspace\\\/\",\"video\":\"https:\\\/\\\/www.zipget.cn\\\/en\\\/video-workspace\\\/\",\"model\":\"https:\\\/\\\/www.zipget.cn\\\/en\\\/3d-workspace\\\/\"}},\"statusUrl\":\"https:\\\/\\\/www.zipget.cn\\\/en\\\/wp-json\\\/shande-creative\\\/v1\\\/status?tool=image\",\"statusNonce\":\"\"};\r\n  let currentBoot=creativeConfig.boot||{mode:'trial'},statusPending=null,draftScope=String(currentBoot.draftScope||''),catalogBusy=false;\r\n  const creativeBanner=host.querySelector('[data-sd-creative-banner]'),creativeDialog=host.querySelector('[data-sd-catalog]');\r\n  const safeUrl=value=>{const url=new URL(value,location.href);if(url.origin!==location.origin||url.username||url.password||!\/^https?:$\/.test(url.protocol))throw Error('\u7ad9\u5185\u5730\u5740\u65e0\u6548\u3002');return url.href;};\r\n  function cleanBoot(){return{initialAsset:creativeConfig.boot?.initialAsset||currentBoot.initialAsset||null,mode:currentBoot.mode,status:currentBoot.status,expiresAt:currentBoot.expiresAt,brand:currentBoot.brand,fontScope:currentBoot.draftScope||'guest',canRetrieve:currentBoot.canRetrieve===true,capabilities:currentBoot.capabilities||{}};}\r\n  function updateCreative(){send({type:'sd:image-workspace-creative-boot',boot:cleanBoot()});if(creativeBanner){creativeBanner.textContent=currentBoot.mode==='member'?'\u4f1a\u5458\u9ad8\u7ea7\u521b\u4f5c\uff1a\u9ad8\u6e05\u4e0e\u6279\u91cf\u5bfc\u51fa\u3002\u514d\u8d39\u3001\u5df2\u8d2d\u7d20\u6750\u6309\u5546\u54c1\u6388\u6743\u76f4\u63a5\u9009\u7528\u3002':currentBoot.mode==='basic'?'\u514d\u8d39\u57fa\u7840\u521b\u4f5c\uff1a\u514d\u8d39\u4e0e\u5df2\u8d2d\u7d20\u6750\u76f4\u63d2\u3001\u672c\u7ad9\u5b57\u4f53\u3001\u56fe\u7247\u7f16\u8f91\u3001\u5355\u56fe\u5bfc\u51fa\u4e0e\u672c\u673a\u8349\u7a3f\u3002':'\u53ef\u7f16\u8f91\u539f\u521b\u793a\u4f8b\u3002\u514d\u8d39\u6ce8\u518c\u6216\u767b\u5f55\u540e\u5904\u7406\u81ea\u5df1\u7684\u56fe\u7247\u3002';}}\r\n  async function refreshStatus(){\r\n    if(statusPending)return statusPending;\r\n    statusPending=(async()=>{if(!creativeConfig.statusUrl)throw Error('\u4f1a\u5458\u670d\u52a1\u6682\u4e0d\u53ef\u7528\u3002');const response=await fetch(safeUrl(creativeConfig.statusUrl),{credentials:'same-origin',cache:'no-store',headers:creativeConfig.statusNonce?{'X-WP-Nonce':creativeConfig.statusNonce}:{}});const value=await response.json().catch(()=>null);if(!response.ok||!value||!['member','basic','trial'].includes(value.mode))throw Error(value?.message||'\u4f1a\u5458\u72b6\u6001\u9a8c\u8bc1\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u9875\u9762\u91cd\u65b0\u767b\u5f55\u3002');currentBoot=value;updateCreative();return value;})().finally(()=>{statusPending=null;});return statusPending;\r\n  }\r\n  async function requireCreativeCapability(capability){const boot=await refreshStatus();if(boot.capabilities?.[capability]!==true)throw Error(capability==='siteAssets'?'\u8bf7\u767b\u5f55\u540e\u9009\u7528\u514d\u8d39\u6216\u5df2\u8d2d\u7d20\u6750\uff1b\u65e0\u9700\u989d\u5916\u5f00\u901a\u521b\u4f5c\u4f1a\u5458\u3002':boot.mode==='trial'?'\u8bf7\u514d\u8d39\u6ce8\u518c\u6216\u767b\u5f55\u540e\u4f7f\u7528\u81ea\u5df1\u7684\u6587\u4ef6\u3002':'\u6b64\u9879\u4e3a\u4f1a\u5458\u9ad8\u7ea7\u529f\u80fd\u3002\u514d\u8d39\u57fa\u7840\u7f16\u8f91\u3001\u5355\u56fe\u5bfc\u51fa\u4e0e\u8349\u7a3f\u4ecd\u53ef\u7ee7\u7eed\u4f7f\u7528\u3002');return boot;}\r\n  \/\/ BEGIN SHANDE_VECTOR_DOWNLOAD_GUARD_V1\r\n  \/\/ Accept only the inert path-only document generated by our local tracing worker.\r\n  async function validateTracedSvgDownload(blob){\r\n    const reject=()=>{throw Error('SVG \u683c\u5f0f\u65e0\u6548\uff1b\u8bf7\u91cd\u65b0\u4f7f\u7528\u5de5\u4f5c\u53f0\u7684\u201c\u4f4d\u56fe\u8f6c SVG\u201d\u751f\u6210\u3002');};\r\n    if(blob.type!=='image\/svg+xml'||blob.size>4000000)return reject();\r\n    const text=await blob.text();\r\n    if(text.length>4000000||!text.startsWith('<svg ')||\/<!|<\\?|&\/.test(text)||(text.match(\/<\/g)||[]).length>18008)return reject();\r\n    const doc=new DOMParser().parseFromString(text,'image\/svg+xml'),root=doc.documentElement;\r\n    if(!root||root.localName!=='svg'||root.namespaceURI!=='http:\/\/www.w3.org\/2000\/svg'||doc.querySelector('parsererror'))return reject();\r\n    function attrs(element,names){return element.attributes.length===names.length&&Array.from(element.attributes).every(a=>names.includes(a.name));}\r\n    function safeNodes(element){return Array.from(element.childNodes).every(n=>n.nodeType===1||n.nodeType===3&&!n.textContent.trim());}\r\n    if(!attrs(root,['xmlns','width','height','viewBox'])||!safeNodes(root))return reject();\r\n    const width=Number(root.getAttribute('width')),height=Number(root.getAttribute('height'));\r\n    if(![width,height].every(n=>Number.isSafeInteger(n)&&n>=1&&n<=32768)||root.getAttribute('viewBox')!=='0 0 '+width+' '+height)return reject();\r\n    const children=Array.from(root.children);\r\n    if(children.length!==2||children[0].localName!=='desc'||children[1].localName!=='g')return reject();\r\n    const [desc,group]=children;\r\n    if(desc.attributes.length||desc.children.length||desc.textContent!=='Basic local bitmap tracing. ImageTracerJS 1.2.6 (Unlicense), integrated by zipget.cn.')return reject();\r\n    if(!attrs(group,['transform'])||!safeNodes(group))return reject();\r\n    const scale=\/^scale\\(([0-9.eE+-]+) ([0-9.eE+-]+)\\)$\/.exec(group.getAttribute('transform'));\r\n    if(!scale||!scale.slice(1).map(Number).every(n=>Number.isFinite(n)&&n>0&&n<=32768))return reject();\r\n    const paths=Array.from(group.children);if(!paths.length||paths.length>18000)return reject();\r\n    for(const path of paths){\r\n      if(path.localName!=='path'||path.namespaceURI!==root.namespaceURI||path.childNodes.length||!attrs(path,['fill','stroke','stroke-width','opacity','d']))return reject();\r\n      const fill=path.getAttribute('fill'),rgb=\/^rgb\\((\\d{1,3}),(\\d{1,3}),(\\d{1,3})\\)$\/.exec(fill);\r\n      if(!rgb||rgb.slice(1).some(v=>Number(v)>255)||path.getAttribute('stroke')!==fill||path.getAttribute('stroke-width')!=='0')return reject();\r\n      const opacity=path.getAttribute('opacity'),number=Number(opacity),d=path.getAttribute('d');\r\n      if(!\/^(?:0(?:\\.\\d+)?|1(?:\\.0+)?)$\/.test(opacity)||!Number.isFinite(number)||number<0||number>1||!d||!\/^M[MLQZ0-9eE+.,\\s-]+$\/.test(d)||\/[0-9.]e[+-]?\\d{4}\/i.test(d))return reject();\r\n    }\r\n  }\r\n  \/\/ END SHANDE_VECTOR_DOWNLOAD_GUARD_V1\r\n\r\n  async function requireDownloadPermission(blob){\r\n    if(!(blob instanceof Blob)||!blob.size||blob.size>100000000)throw Error('\u4e0b\u8f7d\u6587\u4ef6\u65e0\u6548\u6216\u8fc7\u5927\u3002');\r\n    const boot=await refreshStatus(),caps=boot.capabilities||{},mime=String(blob.type||'').toLowerCase();\r\n    if(mime==='image\/svg+xml'){if(caps.advancedExport!==true)throw Error('SVG \u662f\u4f1a\u5458\u9ad8\u7ea7\u5bfc\u51fa\u529f\u80fd\u3002');await validateTracedSvgDownload(blob);return;}\r\n    if(mime==='application\/json'&&caps.localDraft===true)return;\r\n    if(caps.advancedExport===true)return;\r\n    if(caps.basicExport!==true)throw Error('\u514d\u8d39\u6ce8\u518c\u6216\u767b\u5f55\u540e\u5373\u53ef\u5bfc\u51fa\u5355\u5f20\u56fe\u7247\u3002');\r\n    if(!['image\/png','image\/jpeg','image\/webp'].includes(mime))throw Error('\u6279\u91cfZIP\u662f\u4f1a\u5458\u9ad8\u7ea7\u529f\u80fd\uff0c\u514d\u8d39\u7528\u6237\u53ef\u9010\u5f20\u5bfc\u51fa\u56fe\u7247\u3002');\r\n    const b=new Uint8Array(await blob.slice(0,524288).arrayBuffer()),v=new DataView(b.buffer);let width=0,height=0;\r\n    if(mime==='image\/png'&&b.length>=24&&b[0]===137&&String.fromCharCode(...b.slice(1,4))==='PNG'&&String.fromCharCode(...b.slice(12,16))==='IHDR'){width=v.getUint32(16);height=v.getUint32(20);}\r\n    else if(mime==='image\/jpeg'&&b.length>=4&&b[0]===255&&b[1]===216){let p=2;while(p+8<b.length){if(b[p++]!==255)break;while(b[p]===255)p++;const marker=b[p++];if(marker===217||marker===218)break;if(marker===1||(marker>=208&&marker<=215))continue;if(p+2>b.length)break;const size=(b[p]<<8)|b[p+1];if(size<2||p+size>b.length)break;if([192,193,194,195,197,198,199,201,202,203,205,206,207].includes(marker)){height=(b[p+3]<<8)|b[p+4];width=(b[p+5]<<8)|b[p+6];break;}p+=size;}}\r\n    else if(mime==='image\/webp'&&b.length>=30&&String.fromCharCode(...b.slice(0,4))==='RIFF'&&String.fromCharCode(...b.slice(8,12))==='WEBP'){\r\n      const chunk=String.fromCharCode(...b.slice(12,16));\r\n      if(chunk==='VP8X'){width=1+b[24]+(b[25]<<8)+(b[26]<<16);height=1+b[27]+(b[28]<<8)+(b[29]<<16);}\r\n      else if(chunk==='VP8L'&&b[20]===47){width=1+((b[21]|(b[22]<<8))&16383);height=1+(((b[22]>>6)|(b[23]<<2)|(b[24]<<10))&16383);}\r\n      else if(chunk==='VP8 '&&b[23]===157&&b[24]===1&&b[25]===42){width=v.getUint16(26,true)&16383;height=v.getUint16(28,true)&16383;}\r\n    }\r\n    if(!width||!height||width>2048||height>2048)throw Error('\u514d\u8d39\u5355\u56fe\u5bfc\u51fa\u6700\u957f\u8fb92048\u50cf\u7d20\uff1b\u9ad8\u6e05\u539f\u5c3a\u5bf8\u9700\u4f1a\u5458\u3002\u8bf7\u5728\u4e0b\u8f7d\u8bbe\u7f6e\u4e2d\u5173\u95ed\u201c\u4f1a\u5458\u9ad8\u6e05\u201d\u3002');\r\n  }\r\n\r\n  async function creativeFetch(path,body){\r\n    const base=safeUrl(currentBoot.apiBase).replace(\/\\\/$\/,'');const response=await fetch(base+'\/'+path,{method:body===undefined?'GET':'POST',credentials:'same-origin',cache:'no-store',headers:{'X-WP-Nonce':currentBoot.nonce,...(body===undefined?{}:{'Content-Type':'application\/json'})},...(body===undefined?{}:{body:JSON.stringify(body)})});const result=await response.json().catch(()=>null);if(!response.ok)throw Error(result?.message||'\u7d20\u6750\u670d\u52a1\u6682\u4e0d\u53ef\u7528\u3002');return result;\r\n  }\r\n  function draftDatabase(){return new Promise((resolve,reject)=>{if(!window.indexedDB){reject(Error('\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u672c\u673a\u8349\u7a3f\uff0c\u8bf7\u6539\u7528\u201c\u4fdd\u5b58\u9879\u76ee\u201d\u3002'));return;}const request=indexedDB.open('shande-image-workspace',1);request.onupgradeneeded=()=>request.result.createObjectStore('drafts');request.onsuccess=()=>resolve(request.result);request.onerror=()=>reject(Error('\u672c\u673a\u8349\u7a3f\u65e0\u6cd5\u6253\u5f00\u3002\u8bf7\u68c0\u67e5\u6d4f\u89c8\u5668\u5b58\u50a8\u6743\u9650\uff0c\u6216\u4fdd\u5b58\u9879\u76ee\u6587\u4ef6\u3002'));});}\r\n  function draftRecordToken(record){return record?String(record.token||'legacy:'+Number(record.updatedAt||0)):null;}\r\n  async function draftTransaction(mode,value,expectedToken){\r\n    const boot=await refreshStatus();const scope=String(boot.draftScope||'');if(!draftScope||!scope||scope!==draftScope||boot.canRetrieve!==true)throw Error('\u8bf7\u4f7f\u7528\u4fdd\u5b58\u8349\u7a3f\u65f6\u7684\u8d26\u6237\u767b\u5f55\uff0c\u7136\u540e\u91cd\u65b0\u6253\u5f00\u5de5\u4f5c\u53f0\u3002');if(mode==='readwrite'&&boot.capabilities?.localDraft!==true)throw Error('\u8bf7\u5148\u767b\u5f55\u4ee5\u4fdd\u5b58\u672c\u673a\u8349\u7a3f\u3002');\r\n    const db=await draftDatabase();try{return await new Promise((resolve,reject)=>{\r\n      const tx=db.transaction('drafts',mode),store=tx.objectStore('drafts');let output=null,failure=null;\r\n      const read=store.get('image:'+scope);\r\n      read.onsuccess=()=>{const current=read.result;if(mode!=='readwrite'){output=current;return;}\r\n        if(expectedToken!==draftRecordToken(current)){failure=Error('\u672c\u673a\u8349\u7a3f\u5df2\u5728\u5176\u4ed6\u7a97\u53e3\u66f4\u65b0\uff0c\u672a\u8986\u76d6\u3002\u8bf7\u5148\u6062\u590d\u6700\u65b0\u8349\u7a3f\u6216\u4fdd\u5b58\u5f53\u524d\u9879\u76ee\u6587\u4ef6\u3002');tx.abort();return;}\r\n        const token='d_'+(globalThis.crypto?.randomUUID?.()||Date.now().toString(36)+'_'+Math.random().toString(36).slice(2));\r\n        output={text:value,updatedAt:Date.now(),token};store.put(output,'image:'+scope);\r\n      };\r\n      tx.oncomplete=()=>resolve(output);tx.onerror=()=>reject(failure||Error('\u8349\u7a3f\u4fdd\u5b58\u5931\u8d25\uff0c\u6d4f\u89c8\u5668\u53ef\u7528\u7a7a\u95f4\u4e0d\u8db3\u3002\u8bf7\u4e0b\u8f7d\u9879\u76ee\u6587\u4ef6\u5907\u4efd\u3002'));tx.onabort=tx.onerror;\r\n    });}finally{db.close();}\r\n  }\r\n  function openMembership(){const target=safeUrl(currentBoot.mode==='trial'?(currentBoot.loginUrl||creativeConfig.boot?.loginUrl||'\/?shande_auth=login'):(currentBoot.membershipUrl||creativeConfig.boot?.membershipUrl||'\/'));window.open(target,'_blank','noopener');message('\u767b\u5f55\u6216\u4f1a\u5458\u9875\u9762\u5df2\u6253\u5f00\u3002\u5b8c\u6210\u540e\u5237\u65b0\u5de5\u4f5c\u53f0\uff0c\u5373\u53ef\u7ee7\u7eed\u4f7f\u7528\u3002');}\r\n  const catalogState={page:1,q:'',scope:'all',items:[]};\r\n  function catalogMessage(value,error=false){const n=host.querySelector('[data-sd-catalog-status]');n.textContent=value;n.style.color=error?'#b42318':'#58677c';}\r\n  async function loadCatalog(){\r\n    if(catalogBusy)return;catalogBusy=true;catalogMessage('\u6b63\u5728\u8bfb\u53d6\u672c\u7ad9\u7d20\u6750\u2026');host.querySelector('[data-sd-catalog-search]').disabled=true;\r\n    try{await refreshStatus();const query=new URLSearchParams({kind:'image',tool:'image',scope:catalogState.scope,q:catalogState.q,page:String(catalogState.page)});const result=await creativeFetch('catalog?'+query);catalogState.items=Array.isArray(result.items)?result.items.slice(0,48):[];renderCatalog();host.querySelector('[data-sd-catalog-prev]').disabled=catalogState.page<=1;host.querySelector('[data-sd-catalog-next]').disabled=!result.hasMore;catalogMessage(catalogState.items.length?'\u7b2c '+catalogState.page+' \u9875 \u00b7 \u63d2\u5165\u6309\u6240\u9009\u7d20\u6750\u6388\u6743\u8ba1\u5165\u539f\u4e0b\u8f7d\u89c4\u5219':'\u5f53\u524d\u7b5b\u9009\u6ca1\u6709\u53ef\u7528\u56fe\u7247\uff0c\u53ef\u6362\u5173\u952e\u8bcd\u6216\u67e5\u770b\u5168\u90e8\u7d20\u6750\u3002');}catch(error){catalogMessage(error.message,true);}finally{catalogBusy=false;host.querySelector('[data-sd-catalog-search]').disabled=false;}\r\n  }\r\n  function renderCatalog(){const grid=host.querySelector('[data-sd-catalog-grid]');grid.replaceChildren();catalogState.items.forEach(item=>{\r\n    const card=document.createElement('article');card.className='sd-image-asset-card';const thumb=document.createElement('img');thumb.alt='';thumb.loading='lazy';try{const u=new URL(item.previewUrl,location.href);if(u.protocol==='https:'&&!u.username&&!u.password){thumb.src=u.href;thumb.referrerPolicy='no-referrer';}}catch(_){}\r\n    const title=document.createElement('strong');title.textContent=String(item.title||'\u56fe\u7247\u7d20\u6750');const link=document.createElement('a');link.textContent='\u67e5\u770b\u5546\u54c1\u4e0e\u6388\u6743';link.href=safeUrl(item.productUrl);link.target='_blank';link.rel='noopener';\r\n    const choice=document.createElement('select');choice.setAttribute('aria-label','\u9009\u62e9\u7d20\u6750\u6388\u6743');const options=Array.isArray(item.licenseOptions)?item.licenseOptions:[];options.forEach(o=>{const opt=document.createElement('option');opt.value=String(o.key);opt.textContent=String(o.label);choice.append(opt);});\r\n    const insert=document.createElement('button');insert.type='button';insert.textContent=item.canUse?'\u63d2\u5165\u539f\u56fe':'\u9700\u53d6\u5f97\u7d20\u6750\u6388\u6743';insert.disabled=!item.canUse||!options.length;insert.addEventListener('click',async()=>{if(catalogBusy)return;catalogBusy=true;insert.disabled=true;catalogMessage('\u6b63\u5728\u53d6\u5f97\u5df2\u6388\u6743\u539f\u56fe\u2026');try{await useCatalogItem(item,choice.value);catalogMessage('\u539f\u56fe\u5df2\u53d1\u9001\u5230\u5de5\u4f5c\u53f0\uff0c\u8bf7\u5728\u56fe\u5c42\u9762\u677f\u7ee7\u7eed\u7f16\u8f91\u3002');creativeDialog.close();}catch(error){catalogMessage(error.message,true);}finally{catalogBusy=false;insert.disabled=!item.canUse;}});\r\n    card.append(thumb,title,link);if(options.length)card.append(choice);card.append(insert);grid.append(card);\r\n  });}\r\n  async function boundedAsset(response){if(!response.ok)throw Error('\u6388\u6743\u539f\u56fe\u8bfb\u53d6\u5931\u8d25\u3002');if(Number(response.headers.get('content-length'))>40000000)throw Error('\u539f\u56fe\u8d85\u8fc740MB\uff0c\u8bf7\u4e0b\u8f7d\u539f\u6587\u4ef6\u540e\u538b\u7f29\u518d\u5bfc\u5165\u3002');if(!response.body)throw Error('\u6ca1\u6709\u6536\u5230\u539f\u56fe\u5185\u5bb9\u3002');const reader=response.body.getReader(),parts=[];let bytes=0;try{while(true){const p=await reader.read();if(p.done)break;bytes+=p.value.byteLength;if(bytes>40000000){await reader.cancel();throw Error('\u539f\u56fe\u8d85\u8fc740MB\uff0c\u8bf7\u4ece\u5546\u54c1\u9875\u4e0b\u8f7d\u540e\u5904\u7406\u3002');}parts.push(p.value);}}finally{reader.releaseLock();}if(!bytes)throw Error('\u539f\u56fe\u4e3a\u7a7a\u3002');return new Blob(parts,{type:response.headers.get('content-type')?.split(';')[0]||''});}\r\n  \/\/ Both the modal compatibility entry and the inline panel use this same native gateway.\r\n  async function acquireCatalogFile(item,licenseKey,kind){\r\n    await requireCreativeCapability('siteAssets');\r\n    const productId=Number(item.productId);\r\n    if(!Number.isSafeInteger(productId)||productId<1||!['image','font'].includes(kind)||typeof licenseKey!=='string'||licenseKey.length>100)throw Error('\u7d20\u6750\u6216\u6388\u6743\u53c2\u6570\u65e0\u6548\u3002');\r\n    const gateway=await creativeFetch('catalog\/'+productId+'\/use',{intent:kind==='font'?'font':'insert',kind,tool:'image',licenseKey});\r\n    if(gateway.kind!=='gateway'||gateway.assetKind!==kind)throw Error('\u7d20\u6750\u539f\u6587\u4ef6\u7f51\u5173\u65e0\u6548\u3002');\r\n    const form=new URLSearchParams();Object.entries(gateway.gateway?.fields||{}).forEach(([k,v])=>form.set(k,String(v)));\r\n    const response=await fetch(safeUrl(gateway.gateway?.url),{method:'POST',credentials:'same-origin',body:form});\r\n    const result=await response.json().catch(()=>null);\r\n    if(!response.ok||!result?.success)throw Error(result?.data?.message||'\u672a\u53d6\u5f97\u7d20\u6750\u6388\u6743\u3002');\r\n    if(typeof result.data?.creativeDownloadUrl!=='string')throw Error('\u539f\u6587\u4ef6\u5728\u7ebf\u8bfb\u53d6\u6682\u4e0d\u53ef\u7528\uff0c\u8bf7\u4ece\u5546\u54c1\u9875\u4e0b\u8f7d\u540e\u5bfc\u5165\u3002\u8bf7\u52ff\u91cd\u590d\u7533\u8bf7\u4e0b\u8f7d\u3002');\r\n    const original=await fetch(safeUrl(result.data.creativeDownloadUrl),{credentials:'same-origin',cache:'no-store',headers:{'X-WP-Nonce':currentBoot.nonce}});\r\n    const blob=await boundedAsset(original);\r\n    return{blob,productId,title:String(item.title||'\u672c\u7ad9\u7d20\u6750').slice(0,160),licenseKey,filename:String(result.data.filename||item.title||'\u672c\u7ad9\u7d20\u6750').slice(0,240),extension:String(gateway.extension||item.extension||'').toLowerCase()};\r\n  }\r\n  async function useCatalogItem(item,licenseKey){\r\n    if(!catalogState.items.includes(item))throw Error('\u7d20\u6750\u9009\u62e9\u5df2\u5931\u6548\uff0c\u8bf7\u91cd\u65b0\u641c\u7d22\u3002');\r\n    if(!['png','jpg','jpeg','webp'].includes(String(item.extension||'').toLowerCase()))throw Error('\u6b64\u7d20\u6750\u4e3a\u8d44\u6599\u5305\uff0c\u8bf7\u4ece\u5546\u54c1\u9875\u4e0b\u8f7d\u540e\u9009\u62e9PNG\u3001JPG\u6216WebP\u539f\u56fe\u5bfc\u5165\u3002');\r\n    const result=await acquireCatalogFile(item,licenseKey,'image');\r\n    if(!\/^image\\\/(png|jpeg|webp)$\/.test(result.blob.type))throw Error('\u5df2\u53d6\u5f97\u7684\u6587\u4ef6\u4e3a\u8d44\u6599\u5305\uff0c\u8bf7\u4ece\u5546\u54c1\u9875\u4e0b\u8f7d\u540e\u5bfc\u5165\u539f\u56fe\uff1b\u4e0d\u4f1a\u7528\u9884\u89c8\u56fe\u66ff\u4ee3\u3002');\r\n    pending={requestId:++serial,kind:'images',files:[new File([result.blob],result.title+'.'+result.extension,{type:result.blob.type})],sent:false};deliver();\r\n  }\r\n  const inlineCatalogItems=new Map();\r\n  async function inlineCatalogList(data){\r\n    await refreshStatus();\r\n    const kind=data.kind==='font'?'font':'image',scope=['all','free','favorites','purchased'].includes(data.scope)?data.scope:'all',q=typeof data.q==='string'?data.q.trim().slice(0,100):'',page=Math.max(1,Math.min(10000,Math.round(Number(data.page)||1))),category=Math.max(0,Math.round(Number(data.category)||0));\r\n    const productId=Number(data.productId),located=Number.isSafeInteger(productId)&&productId>0?String(productId):'';\r\n    const result=await creativeFetch('catalog?'+new URLSearchParams({kind,tool:'image',scope,q,page:String(page),category:category?String(category):'',...(located?{productId:located}:{})}));\r\n    const categoryList=values=>(Array.isArray(values)?values:[]).slice(0,250).map(value=>({id:Number(value.id),name:String(value.name||'').slice(0,100),parent:Number(value.parent)||0})).filter(value=>Number.isSafeInteger(value.id)&&value.id>0);\r\n    const items=(Array.isArray(result.items)?result.items:[]).slice(0,48).map(item=>({productId:Number(item.productId),title:String(item.title||'\u672c\u7ad9\u7d20\u6750').slice(0,160),previewUrl:String(item.previewUrl||''),productUrl:safeUrl(item.productUrl),extension:String(item.extension||'').toLowerCase(),kind,canUse:item.canUse===true,isFree:item.isFree===true,accessLabel:String(item.accessLabel||'').slice(0,80),priceLabel:String(item.priceLabel||'').slice(0,80),categories:categoryList(item.categories),licenseOptions:(Array.isArray(item.licenseOptions)?item.licenseOptions:[]).slice(0,12).map(v=>({key:String(v.key).slice(0,100),label:String(v.label).slice(0,120)}))})).filter(item=>Number.isSafeInteger(item.productId)&&item.productId>0);\r\n    items.forEach(item=>inlineCatalogItems.set(kind+':'+item.productId,item));\r\n    while(inlineCatalogItems.size>200)inlineCatalogItems.delete(inlineCatalogItems.keys().next().value);\r\n    return{items,page,hasMore:result.hasMore===true,categories:categoryList(result.categories)};\r\n  }\r\n  async function inlineCatalogUse(data){\r\n    if(pending||processing)throw Error('\u5de5\u4f5c\u53f0\u6b63\u5728\u5904\u7406\u6587\u4ef6\uff0c\u8bf7\u7a0d\u540e\u518d\u63d2\u5165\u7d20\u6750\u3002');\r\n    const item=inlineCatalogItems.get('image:'+Number(data.productId));\r\n    if(!item)throw Error('\u7d20\u6750\u5217\u8868\u5df2\u66f4\u65b0\uff0c\u8bf7\u91cd\u65b0\u641c\u7d22\u540e\u63d2\u5165\u3002');\r\n    if(!['png','jpg','jpeg','webp','zip'].includes(item.extension))throw Error('\u5f53\u524d\u652f\u6301 PNG\u3001JPG\u3001WebP \u53ca\u5305\u542b\u8fd9\u4e9b\u56fe\u7247\u7684 ZIP \u539f\u5305\u3002');\r\n    \/\/ Transfer only the original native-authorized bytes. The iframe safely chooses ZIP entries.\r\n    return acquireCatalogFile(item,String(data.licenseKey||''),'image');\r\n  }\r\n\r\n  async function inlineFontFile(data){\r\n    const productId=Number(data.productId);\r\n    if(!Number.isSafeInteger(productId)||productId<1)throw Error('\u5b57\u4f53\u7f16\u53f7\u65e0\u6548\u3002');\r\n    \/\/ Restored projects may reference a font outside the current search page. The server rechecks\r\n    \/\/ published Font products, ownership, source hash and the actual native product entitlement.\r\n    const item=inlineCatalogItems.get('font:'+productId)||{productId,title:'\u672c\u7ad9\u5b57\u4f53 '+productId};\r\n    return acquireCatalogFile(item,String(data.licenseKey||''),'font');\r\n  }\r\n  function inlineCatalogProduct(data){\r\n    const kind=data.kind==='font'?'font':'image',item=inlineCatalogItems.get(kind+':'+Number(data.productId));\r\n    if(!item)throw Error('\u7d20\u6750\u5217\u8868\u5df2\u66f4\u65b0\uff0c\u8bf7\u91cd\u65b0\u641c\u7d22\u540e\u6253\u5f00\u5546\u54c1\u3002');\r\n    const url=safeUrl(item.productUrl);window.open(url,'_blank','noopener');message('\u5546\u54c1\u4e0e\u6388\u6743\u9875\u9762\u5df2\u6253\u5f00\u3002\u5f53\u524d\u4f5c\u54c1\u4fdd\u7559\u5728\u6b64\u5de5\u4f5c\u53f0\uff1b\u5b8c\u6210\u540e\u8fd4\u56de\u5e76\u70b9\u51fb\u201c\u5237\u65b0\u6388\u6743\u201d\u3002');return{};\r\n  }\r\n\r\n  host.querySelector('[data-sd-member-link]')?.addEventListener('click',openMembership);\r\n  host.querySelector('[data-sd-catalog-close]')?.addEventListener('click',()=>creativeDialog.close());\r\n  host.querySelector('[data-sd-catalog-form]')?.addEventListener('submit',event=>{event.preventDefault();catalogState.page=1;catalogState.q=host.querySelector('[data-sd-catalog-q]').value.trim().slice(0,100);catalogState.scope=host.querySelector('[data-sd-catalog-scope]').value;loadCatalog();});\r\n  host.querySelector('[data-sd-catalog-prev]')?.addEventListener('click',()=>{if(catalogState.page>1){catalogState.page--;loadCatalog();}});host.querySelector('[data-sd-catalog-next]')?.addEventListener('click',()=>{catalogState.page++;loadCatalog();});\r\n  async function handleCreativeRequest(data){\r\n    if(!Number.isSafeInteger(data.requestId)||data.requestId<1)return;const reply=(ok,result,message)=>send({type:'sd:image-workspace-creative-result',requestId:data.requestId,ok,result,message});\r\n    try{switch(data.operation){\r\n      case 'workspace-focus':if(typeof data.enabled!=='boolean')throw Error('\u4e13\u6ce8\u6a21\u5f0f\u53c2\u6570\u65e0\u6548\u3002');reply(true,setWorkspaceFocus(data.enabled));return;\r\n      case 'authorize':{const allowedActions=['import','basicExport','localDraft','advancedExport','siteAssets'];if(!allowedActions.includes(data.action))throw Error('\u64cd\u4f5c\u7c7b\u578b\u65e0\u6548\u3002');const boot=await refreshStatus();reply(true,{allowed:boot.capabilities?.[data.action]===true,boot:cleanBoot()});return;}\r\n      case 'membership':openMembership();reply(true,{});return;\r\n      case 'catalog-list':reply(true,await inlineCatalogList(data));return;\r\n      case 'catalog-use':reply(true,await inlineCatalogUse(data));return;\r\n      case 'font-fetch':reply(true,await inlineFontFile(data));return;\r\n      case 'catalog-product':reply(true,inlineCatalogProduct(data));return;\r\n      case 'catalog-open':await refreshStatus();creativeDialog.showModal();catalogState.page=1;loadCatalog();reply(true,{});return;\r\n      case 'draft-peek':{const record=await draftTransaction('readonly');let name='';if(record?.text){try{name=String(JSON.parse(record.text).name||'').replace(\/[\\u0000-\\u001f]\/g,'').slice(0,80);}catch(_){}}reply(true,{exists:!!record,token:draftRecordToken(record),updatedAt:record?.updatedAt||0,name});return;}\r\n      case 'draft-save':{if(typeof data.text!=='string'||new Blob([data.text]).size>50000000)throw Error('\u8349\u7a3f\u5927\u5c0f\u8d85\u8fc750MB\uff0c\u8bf7\u4e0b\u8f7d\u9879\u76ee\u6587\u4ef6\u3002');if(data.expectedToken!==null&&typeof data.expectedToken!=='string')throw Error('\u8349\u7a3f\u72b6\u6001\u672a\u786e\u8ba4\uff0c\u8bf7\u5148\u68c0\u67e5\u672c\u673a\u8349\u7a3f\u3002');const record=await draftTransaction('readwrite',data.text,data.expectedToken);reply(true,{token:record.token,updatedAt:record.updatedAt});return;}\r\n      case 'draft-open':{const record=await draftTransaction('readonly');if(!record||typeof record.text!=='string'||new Blob([record.text]).size>50000000)throw Error('\u6b64\u8d26\u6237\u5728\u5f53\u524d\u6d4f\u89c8\u5668\u8fd8\u6ca1\u6709\u6709\u6548\u8349\u7a3f\u3002');const url=URL.createObjectURL(new Blob([record.text],{type:'application\/json'}));downloadRecords.unshift({url,name:'\u95ea\u5f97\u56fe\u7247-\u5df2\u4fdd\u5b58\u8349\u7a3f.json',size:new Blob([record.text]).size});while(downloadRecords.length>5)URL.revokeObjectURL(downloadRecords.pop().url);downloadBox.hidden=false;const link=document.createElement('a');link.href=url;link.download='\u95ea\u5f97\u56fe\u7247-\u5df2\u4fdd\u5b58\u8349\u7a3f.json';link.textContent='\u4e0b\u8f7d\u539f\u6709\u8349\u7a3f\u5907\u4efd\uff08\u4f1a\u5458\u5230\u671f\u4ecd\u53ef\u53d6\u56de\uff09';link.style.display='block';downloadBox.append(link);reply(true,{text:record.text,updatedAt:record.updatedAt,token:draftRecordToken(record)});return;}\r\n      default:throw Error('\u4e0d\u652f\u6301\u6b64\u64cd\u4f5c\u3002');\r\n    }}catch(error){reply(false,null,error.message||'\u64cd\u4f5c\u6682\u4e0d\u53ef\u7528\u3002');}\r\n  }\r\n  updateCreative();\r\n\r\n  buttons.forEach(button=>button.addEventListener(\"click\",()=>choose(button.dataset.sdHostPick)));\r\n  [[imageInput,\"images\"],[projectInput,\"project\"]].forEach(([input,kind])=>{\r\n    input.addEventListener(\"change\",async()=>{\r\n      const files=Array.from(input.files||[]);input.value=\"\";\r\n      if(!files.length){pending=null;return;}\r\n      if(files.length>(kind===\"images\"?20:1)||!files.every(file=>file instanceof File&&Number.isFinite(file.size)&&file.size<=(kind===\"images\"?40000000:100000000))){pending=null;message(\"\u56fe\u7247\u6700\u591a20\u5f20\u3001\u6bcf\u5f2040MB\uff1b\u9879\u76ee\u6700\u591a1\u4e2a\u3001100MB\uff0c\u8bf7\u5206\u6279\u9009\u62e9\u3002\");return;}\r\n      try{await requireCreativeCapability('import');}catch(error){pending=null;message(error.message);return;}pending={requestId:++serial,kind,files,sent:false};message(\"\u672c\u673a\u6587\u4ef6\u5df2\u9009\u62e9\uff0c\u6b63\u5728\u4ea4\u7ed9\u5de5\u4f5c\u53f0\u5904\u7406\u3002\u6587\u4ef6\u4e0d\u4f1a\u4e0a\u4f20\u3002\");deliver();\r\n    });\r\n    input.addEventListener(\"cancel\",()=>{pending=null;});\r\n  });\r\n  window.addEventListener(\"message\",event=>{\r\n    if(event.source!==frame.contentWindow||event.origin!==\"null\")return;\r\n    const data=event.data;if(!data||typeof data.type!==\"string\")return;\r\n    if(data.type===\"sd:image-workspace-height\"){\r\n      if(workspaceFocused){reportViewport();return;}\r\n      const height=Number(data.height);if(Number.isFinite(height)&&height>=400&&height<=6000&&Math.abs(height-parseFloat(frame.style.height||\"0\"))>1)frame.style.height=Math.ceil(height)+\"px\";reportViewport();return;\r\n    }\r\n    if(data.protocol!==1||data.generation!==generation)return;\r\n    if(data.type===\"sd:image-workspace-host-ready\"){\r\n      ready=true;setBusy(data.busy);send({type:\"sd:image-workspace-host-ack\"});updateCreative();lastViewport=\"\";reportViewport();deliver();return;\r\n    }\r\n    if(data.type===\"sd:image-workspace-host-dirty\"){dirty=data.dirty===true;return;}\r\n    if(data.type===\"sd:image-workspace-host-busy\"){\r\n      setBusy(data.busy);if(!processing)deliver();return;\r\n    }\r\n    if(data.type===\"sd:image-workspace-host-select\"){\r\n      if(data.kind===\"images\"||data.kind===\"project\")choose(data.kind);return;\r\n    }\r\n    if(data.type===\"sd:image-workspace-creative-request\"){return handleCreativeRequest(data);}\r\n    if(data.type===\"sd:image-workspace-host-download\"){return receiveDownload(data);}\r\n    if(data.type===\"sd:image-workspace-host-received\"&&pending&&data.requestId===pending.requestId){\r\n      pending=null;\r\n      message(data.status===\"busy\"?\"\u5de5\u4f5c\u53f0\u6b63\u5728\u5904\u7406\uff0c\u8bf7\u5b8c\u6210\u540e\u91cd\u65b0\u9009\u62e9\u672c\u673a\u6587\u4ef6\u3002\":data.status===\"rejected\"?\"\u6587\u4ef6\u672a\u88ab\u63a5\u53d7\uff0c\u8bf7\u67e5\u770b\u5de5\u4f5c\u53f0\u5185\u63d0\u793a\u5e76\u91cd\u65b0\u9009\u62e9\u3002\":\"\u6587\u4ef6\u5df2\u4ea4\u7ed9\u5de5\u4f5c\u53f0\uff1b\u8bfb\u53d6\u7ed3\u679c\u8bf7\u67e5\u770b\u5de5\u4f5c\u53f0\u5185\u63d0\u793a\u3002\");\r\n    }\r\n  });\r\n  frame.addEventListener(\"load\",()=>{generation++;ready=false;dirty=false;if(pending)pending.sent=false;setBusy(false);seenDownloads.clear();send({type:\"sd:image-workspace-host-ping\"});lastViewport=\"\";reportViewport();});\r\n  window.addEventListener(\"pagehide\",event=>{if(!event.persisted){downloadRecords.forEach(item=>URL.revokeObjectURL(item.url));downloadRecords=[];pending=null;}});\r\n  send({type:\"sd:image-workspace-host-ping\"});reportViewport();\r\n})();<\/script><p class=\"sd-image-workspace-license\" style=\"text-align:right;font-size:12px;line-height:1.8;margin:10px 0 0;\"><a href=\"https:\/\/www.zipget.cn\/wp-content\/uploads\/shande-image-workspace\/THIRD-PARTY-NOTICES.txt\" target=\"_blank\" rel=\"noopener noreferrer\">\u5f00\u6e90\u8bb8\u53ef\u4e0e\u7248\u6743<\/a><\/p><\/section><p class=\"sd-creative-storage-note\" style=\"margin:0;padding:10px 14px;border-top:1px solid #e2e8f0;background:#f8fafc;color:#526277;font-size:12px;line-height:1.7\">\u672c\u673a\u8349\u7a3f\u4e0d\u662f\u4e91\u5907\u4efd\u3002\u5173\u95ed\u672a\u4fdd\u5b58\u7684\u9875\u9762\u3001\u6e05\u7406\u6d4f\u89c8\u5668\u6570\u636e\u6216\u5207\u6362\u6d4f\u89c8\u5668\u53ef\u80fd\u4e22\u5931\uff0c\u8bf7\u53ca\u65f6\u5bfc\u51fa\u81f3\u672c\u5730\u3002<\/p><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-dfe386a2 elementor-widget elementor-widget-text-editor\" data-id=\"dfe386a2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p><a href=\"https:\/\/www.zipget.cn\/wp-content\/uploads\/shande-image-workspace\/THIRD-PARTY-NOTICES.txt\" target=\"_blank\" rel=\"noopener\">\u5f00\u6e90\u7ec4\u4ef6\u8bb8\u53ef\u4e0e\u7248\u6743\u8bf4\u660e<\/a><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u521b\u4f5c\u5de5\u4f5c\u53f0 PPT\u7f16\u8f91 \u56fe\u7247\u7f16\u8f91 Wor [&hellip;]<\/p>\n","protected":false},"author":204729511,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_header_footer","meta":{"site-sidebar-layout":"no-sidebar","site-content-layout":"","ast-site-content-layout":"full-width-container","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_shande_transparent_header":false,"footnotes":""},"class_list":["post-5152","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.zipget.cn\/en\/wp-json\/wp\/v2\/pages\/5152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zipget.cn\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.zipget.cn\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.zipget.cn\/en\/wp-json\/wp\/v2\/users\/204729511"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zipget.cn\/en\/wp-json\/wp\/v2\/comments?post=5152"}],"version-history":[{"count":7,"href":"https:\/\/www.zipget.cn\/en\/wp-json\/wp\/v2\/pages\/5152\/revisions"}],"predecessor-version":[{"id":5266,"href":"https:\/\/www.zipget.cn\/en\/wp-json\/wp\/v2\/pages\/5152\/revisions\/5266"}],"wp:attachment":[{"href":"https:\/\/www.zipget.cn\/en\/wp-json\/wp\/v2\/media?parent=5152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}