@simai-studio/view 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +5 -5
  2. package/dist/package-receipt.json +322 -81
  3. package/dist/set.json +35 -2
  4. package/dist/smart/rule.js +94 -0
  5. package/dist/smart/rule.js.gz +0 -0
  6. package/dist/smart/view/component.json +1 -1
  7. package/dist/smart/view/component.json.gz +0 -0
  8. package/dist/smart/view/js/view.js +1 -1
  9. package/dist/smart/view/js/view.js.gz +0 -0
  10. package/dist/smart/view/js/view.min.js +1 -1
  11. package/dist/smart/view/js/view.min.js.gz +0 -0
  12. package/dist/smart/view/smart.manifest.json +1 -1
  13. package/dist/smart/view/smart.manifest.json.gz +0 -0
  14. package/dist/smart/view/static/default/open-record.html +1 -1
  15. package/dist/smart/view/static/default/open-record.html.gz +0 -0
  16. package/dist/smart/view/static/default/reference.html +1 -1
  17. package/dist/smart/view/static/default/reference.html.gz +0 -0
  18. package/dist/smart/view-flow/component.json +620 -0
  19. package/dist/smart/view-flow/component.json.gz +0 -0
  20. package/dist/smart/view-flow/css/view-flow.css +570 -0
  21. package/dist/smart/view-flow/css/view-flow.css.gz +0 -0
  22. package/dist/smart/view-flow/css/view-flow.min.css +3 -0
  23. package/dist/smart/view-flow/css/view-flow.min.css.gz +0 -0
  24. package/dist/smart/view-flow/examples.json +452 -0
  25. package/dist/smart/view-flow/examples.json.gz +0 -0
  26. package/dist/smart/view-flow/js/view-flow.js +7406 -0
  27. package/dist/smart/view-flow/js/view-flow.js.gz +0 -0
  28. package/dist/smart/view-flow/js/view-flow.min.js +749 -0
  29. package/dist/smart/view-flow/js/view-flow.min.js.gz +0 -0
  30. package/dist/smart/view-flow/lang/en.json +24 -0
  31. package/dist/smart/view-flow/lang/en.json.gz +0 -0
  32. package/dist/smart/view-flow/lang/ru.json +24 -0
  33. package/dist/smart/view-flow/lang/ru.json.gz +0 -0
  34. package/dist/smart/view-flow/probe.json +149 -0
  35. package/dist/smart/view-flow/probe.json.gz +0 -0
  36. package/dist/smart/view-flow/smart.manifest.json +486 -0
  37. package/dist/smart/view-flow/smart.manifest.json.gz +0 -0
  38. package/dist/smart/view-flow/static/default/answered.html +57 -0
  39. package/dist/smart/view-flow/static/default/answered.html.gz +0 -0
  40. package/dist/smart/view-flow/static/default/ask.html +146 -0
  41. package/dist/smart/view-flow/static/default/ask.html.gz +0 -0
  42. package/dist/smart/view-flow/static/default/expired.html +16 -0
  43. package/dist/smart/view-flow/static/default/expired.html.gz +0 -0
  44. package/dist/smart/view-flow/static/default/groups.html +44 -0
  45. package/dist/smart/view-flow/static/default/groups.html.gz +0 -0
  46. package/dist/smart/view-flow/static/default/reference.html +72 -0
  47. package/dist/smart/view-flow/static/default/reference.html.gz +0 -0
  48. package/dist/smart/view-flow/static/default/untitled.html +41 -0
  49. package/dist/smart/view-flow/static/default/untitled.html.gz +0 -0
  50. package/dist/smart/view-flow/static/sheets.json +443 -0
  51. package/dist/smart/view-flow/static/sheets.json.gz +0 -0
  52. package/dist/smart/view-flow/template/default.css +180 -0
  53. package/dist/smart/view-flow/template/default.css.gz +0 -0
  54. package/dist/smart/view-flow/template/default.js +136 -0
  55. package/dist/smart/view-flow/template/default.js.gz +0 -0
  56. package/dist/smart/view-properties/component.json +8 -1
  57. package/dist/smart/view-properties/component.json.gz +0 -0
  58. package/dist/smart/view-properties/css/view-properties.css +367 -0
  59. package/dist/smart/view-properties/css/view-properties.css.gz +0 -0
  60. package/dist/smart/view-properties/css/view-properties.min.css +1 -0
  61. package/dist/smart/view-properties/css/view-properties.min.css.gz +0 -0
  62. package/dist/smart/view-properties/js/view-properties.js +1755 -169
  63. package/dist/smart/view-properties/js/view-properties.js.gz +0 -0
  64. package/dist/smart/view-properties/js/view-properties.min.js +491 -378
  65. package/dist/smart/view-properties/js/view-properties.min.js.gz +0 -0
  66. package/dist/smart/view-properties/smart.manifest.json +38 -3
  67. package/dist/smart/view-properties/smart.manifest.json.gz +0 -0
  68. package/dist/smart/view-properties/template/default.js +1 -77
  69. package/dist/smart/view-properties/template/default.js.gz +0 -0
  70. package/dist/smart/view-table/js/view-table.js +2 -0
  71. package/dist/smart/view-table/js/view-table.js.gz +0 -0
  72. package/dist/smart/view-table/js/view-table.min.js +2 -0
  73. package/dist/smart/view-table/js/view-table.min.js.gz +0 -0
  74. package/package.json +1 -1
@@ -1,13 +1,13 @@
1
- (()=>{"use strict";var e={e577837dd70a(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{Yq:()=>l});var n=i("15b4e93ff6ed"),s=e([n]),o=s.then?(await s)():s;n=o[0];function a(e){return"short"===e||"medium"===e||"long"===e||"full"===e}function l(e,{date:t="medium",time:i=null,intl:r=null,gap:s="",...o}={}){const l=(0,n.ay)(e);if(!l)return s;let c=r;return c||(c={},a(t)&&(c.dateStyle=t),a(i)&&(c.timeStyle=i),c.dateStyle||c.timeStyle||(c.dateStyle="medium")),(0,n.Qz)("DateTimeFormat",(0,n.OE)(o),c).format(l)}r()}catch(c){r(c)}})},"15b4e93ff6ed"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{OE:()=>a,Qz:()=>u,ay:()=>l});var n=i("43090d1c8307"),s=e([n]),o=s.then?(await s)():s;n=o[0];function a({locale:e,node:t}={}){return String(e||"").trim()||(0,n.pageLocale)(t)}function l(e){if(null==e||""===e)return null;const t=e instanceof Date?new Date(e.getTime()):new Date("string"==typeof e&&/^\d+$/u.test(e)?Number(e):e);return Number.isNaN(t.getTime())?null:t}function c(){const e="undefined"!=typeof globalThis?globalThis:{};return e.__sfFormat||(e.__sfFormat={formatters:new Map}),e.__sfFormat.formatters}function u(e,t,i){const r=`${e}|${t}|${JSON.stringify(i)}`,n=c();if(n.has(r))return n.get(r);const s=Intl[e];let o;try{o=new s(t||void 0,i)}catch{try{o=new s(void 0,i)}catch{o=new s(t||void 0,"NumberFormat"===e?{maximumFractionDigits:2}:{})}}return n.size>=256&&n.delete(n.keys().next().value),n.set(r,o),o}r()}catch(d){r(d)}})},"1b42c5117087"(e,t,i){const r=Object.freeze(["folder","folder_open","topic","home","dashboard","apartment","store","storefront","business_center","work","badge","person","group","groups","account_circle","manage_accounts","supervisor_account","contacts","school","menu_book","assignment","task","description","article","note_alt","edit_note","draft","receipt","receipt_long","request_quote","inventory_2","category","label","sell","local_offer","shopping_cart","shopping_bag","payments","savings","credit_card","account_balance","calculate","percent","trending_up","analytics","insights","monitoring","bar_chart","pie_chart","table_chart","schedule","event","today","calendar_month","date_range","history","alarm","timer","update","hourglass_top","mail","outgoing_mail","chat","forum","sms","call","phone_in_talk","contact_support","campaign","notifications","language","public","place","map","location_on","travel_explore","flight","local_shipping","route","directions","settings","tune","build","construction","handyman","code","terminal","data_object","api","bug_report","database","storage","cloud","backup","sync","folder_zip","upload_file","download","attach_file","link","lock","lock_open","shield","verified_user","key","admin_panel_settings","policy","gavel","fingerprint","visibility","palette","format_paint","image","photo_library","collections","movie","play_circle","mic","headphones","brush"]);"undefined"!=typeof globalThis&&(globalThis.SF=globalThis.SF||{},globalThis.SF.icons=globalThis.SF.icons||{},globalThis.SF.icons.choices||(globalThis.SF.icons.choices=r));i.d(t,["x",0,r])},"9ce1a42b2a85"(e,t,i){i.d(t,{AC:()=>o,MC:()=>d,SB:()=>u,cy:()=>l,d2:()=>a});const r=/^(\d{4}-\d{2}-\d{2})(?:[T ](\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/u,n=/^\d{4}-\d{2}-\d{2}$/u;function s(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e}function o(e){const t=s(e);if(null==t||""===t)return{raw:t??null,known:!0,date:"",time:"",rest:"",zone:""};const i="string"==typeof t?t.trim().match(r):null;return i?{raw:t,known:!0,date:i[1],time:i[2]?`${i[2]}:${i[3]}`:"",rest:i[4]||"",zone:i[5]||""}:{raw:t,known:!1,date:"",time:"",rest:"",zone:""}}function a(e){const t=String(e??"").trim().replace(/[_\s]/gu,"");if(""===t||":"===t)return"";const i=t.match(/^(\d{1,2})[:.]?(\d{2})$/u);if(!i)return null;const r=Number(i[1]),n=Number(i[2]);return r>23||n>59?null:`${String(r).padStart(2,"0")}:${i[2]}`}function l(e,t){const i=String(t?.date??"").trim(),r=a(t?.time);if(null===r)return{error:"timeInvalid"};if(!i&&!r)return{value:null};if(!n.test(i))return{error:i?"dateInvalid":"dateMissing"};if(!r)return{error:"timeMissing"};const s=e?.known?e:null;if(s&&s.date===i&&s.time===r)return{value:s.raw};return{value:`${i}T${r}${s&&s.time===r?s.rest:":00"}${s&&s.time?s.zone:""}`}}const c=/^(\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?$/u;function u(e){const t=s(e);if(null==t||""===t)return{raw:t??null,known:!0,time:"",rest:""};const i="string"==typeof t?t.trim().match(c):null;return i&&null!==a(`${i[1]}:${i[2]}`)?{raw:t,known:!0,time:`${i[1]}:${i[2]}`,rest:i[3]||""}:{raw:t,known:!1,time:"",rest:""}}function d(e,t){const i=a(t);if(null===i)return{error:"timeInvalid"};if(!i)return{value:null};const r=e?.known?e:null;return r&&r.time===i?{value:r.raw}:{value:r?.rest?`${i}:00`:i}}},eb06ad68f8d3(e,t,i){i.d(t,{b:()=>R,j:()=>M});Object.freeze(["p","h2","h3","h4","strong","em","a","ul","ol","li","blockquote","br"]);const r=Object.freeze(["p","h2","h3","h4"]),n=Object.freeze(["https:","mailto:","tel:"]),s=Object.freeze(["html","paste"]),o=(Object.freeze(["pre","table"]),new Set(["script","style","template","head","title","meta","link","base","noscript","iframe","frame","frameset","noembed","noframes","object","embed","applet","svg","math","canvas","video","audio","img","picture","source","track","input","select","textarea","xmp","plaintext"])),a=new Set(["address","article","aside","body","caption","center","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h5","h6","header","hgroup","hr","html","legend","listing","main","menu","nav","optgroup","option","pre","section","summary","table","tbody","td","tfoot","th","thead","tr"]),l=new Set(["ul","ol"]),c=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),u=new Set(["script","style","textarea","title","xmp","iframe","noembed","noframes","noscript"]),d=new Set(["td","th","table","caption","button"]),p=/[\u0000-\u001f\u007f-\u009f]/gu,h=/[\u0000- \u007f-\u009f\u00a0\u1680\u2000-\u200b\u2028\u2029\u202f\u205f\u3000\ufeff]/gu;const f={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",shy:"­",hellip:"…",mdash:"—",ndash:"–",minus:"−",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",bull:"•",middot:"·",copy:"©",reg:"®",trade:"™",deg:"°",times:"×",divide:"÷",plusmn:"±",euro:"€",pound:"£",yen:"¥",cent:"¢",sect:"§",para:"¶",thinsp:" ",ensp:" ",emsp:" ",zwj:"‍",zwnj:"‌",larr:"←",rarr:"→",uarr:"↑",darr:"↓",numero:"№",prime:"′",Prime:"″"};function g(e){return String(e).replace(/&(#x[0-9a-f]+|#[0-9]+|[a-z][a-z0-9]*);?/giu,(e,t)=>{if("#"===t[0]){const e="x"===t[1]||"X"===t[1]?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return!Number.isFinite(e)||e<=0||e>1114111||e>=55296&&e<=57343?"�":String.fromCodePoint(e)}return Object.hasOwn(f,t)&&e.endsWith(";")?f[t]:e})}function m(e){const t="string"==typeof e?e:"",i={type:"element",name:"#root",attrs:{},children:[]},n=[i],s=()=>n[n.length-1],o=e=>s().children.push(e),p=e=>{if(!e)return;const t=s().children.at(-1);"text"===t?.type?t.value+=e:o({type:"text",value:e})},h=(e,t=null)=>{for(let i=n.length-1;i>0;i-=1){const r=n[i].name;if(t&&t.has(r))return!1;if(r===e)return n.length=i,!0}return!1};let f=0;const m=t.length;for(;f<m;){const e=t.indexOf("<",f);if(e<0){p(g(t.slice(f)));break}if(e>f&&p(g(t.slice(f,e))),f=e,t.startsWith("\x3c!--",f)){const e=t.indexOf("--\x3e",f+4);f=e<0?m:e+3;continue}const i=t[f+1]??"";if("!"===i||"?"===i){const e=t.indexOf(">",f+2);f=e<0?m:e+1;continue}if("/"===i){const e=/^<\/([a-z][a-z0-9-]*)[^>]*>?/iu.exec(t.slice(f));if(!e){const e=t.indexOf(">",f+2);f=e<0?m:e+1;continue}f+=e[0].length;const i=e[1].toLowerCase();"br"===i?o({type:"element",name:"br",attrs:{},children:[]}):"p"!==i||h("p",d)?h(i):o({type:"element",name:"p",attrs:{},children:[]});continue}const s=/^<([a-z][a-z0-9-]*)/iu.exec(t.slice(f));if(!s){p("<"),f+=1;continue}f+=s[0].length;const v=s[1].toLowerCase(),b={};let y=!1;for(;f<m;){const e=/^[\s/]+/u.exec(t.slice(f));if(e){e[0].includes("/")&&">"===t[f+e[0].length]&&(y=!0),f+=e[0].length;continue}if(">"===t[f]){f+=1;break}const i=/^([^\s/>"'=][^\s/>"'=]*)(?:\s*=\s*(?:"([^"]*)"?|'([^']*)'?|([^\s>]*)))?/u.exec(t.slice(f));if(!i){f+=1;continue}f+=i[0].length;const r=i[1].toLowerCase();Object.hasOwn(b,r)||(b[r]=g(i[2]??i[3]??i[4]??""))}const w={type:"element",name:v,attrs:b,children:[]};if("li"===v&&h("li",l),(r.includes(v)||l.has(v)||"blockquote"===v||a.has(v))&&h("p",d),o(w),"plaintext"===v){f=m;break}if(u.has(v)){const e=new RegExp(`</${v}[\\s/>]`,"iu").exec(t.slice(f)),i=e?f+e.index:m;"textarea"===v||"title"===v?w.children.push({type:"text",value:g(t.slice(f,i))}):w.children.push({type:"text",value:t.slice(f,i)});const r=e?t.indexOf(">",i):-1;f=r<0?m:r+1;continue}c.has(v)||y||n.push(w)}return i}function v(e){const t=e=>{if(3===e.nodeType)return{type:"text",value:e.data};if(11===e.nodeType)return{type:"element",name:"#root",attrs:{},children:[...e.childNodes].map(t).filter(Boolean)};if(1!==e.nodeType)return null;if(e.namespaceURI&&"http://www.w3.org/1999/xhtml"!==e.namespaceURI)return null;const i=e.localName;if(o.has(i))return null;const r={},n=e.getAttribute("href");null!==n&&(r.href=n);const s=e.getAttribute("style");null!==s&&(r.style=s);return{type:"element",name:i,attrs:r,children:"template"===i?[]:[...e.childNodes].map(t).filter(Boolean)}},i=t(e);return i&&"element"===i.type?{...i,name:"#root"}:{type:"element",name:"#root",attrs:{},children:i?[i]:[]}}function b(e,t){const i={...t};"strong"!==e.name&&"b"!==e.name||(i.strong=!0),"em"!==e.name&&"i"!==e.name||(i.em=!0);const r=function(e){const t={};if(!e)return t;const i=/(?:^|;)\s*font-weight\s*:\s*([^;!]+)/iu.exec(e)?.[1]?.trim().toLowerCase();i&&("bold"===i||"bolder"===i||Number(i)>=600?t.strong=!0:("normal"===i||"lighter"===i||Number(i)<600)&&(t.strong=!1));const r=/(?:^|;)\s*font-style\s*:\s*([^;!]+)/iu.exec(e)?.[1]?.trim().toLowerCase();return r&&("italic"===r||r.startsWith("oblique")?t.em=!0:"normal"===r&&(t.em=!1)),t}(e.attrs?.style);return void 0!==r.strong&&(i.strong=r.strong),void 0!==r.em&&(i.em=r.em),i}const y=(e,t,i)=>({kind:e,value:t,strong:Boolean(i.marks.strong),em:Boolean(i.marks.em),href:i.href||null});class w{constructor(e){this.kind=e,this.blocks=[],this.run=[],this.types=["p"],this.starts=[0],this.needBreak=!1}inline(e){"item"===this.kind&&this.needBreak&&this.run.length>0&&("text"!==e.kind||e.value.trim())&&(this.run.push({kind:"br",strong:!1,em:!1,href:null}),this.needBreak=!1),this.run.push(e)}flush(){this.run.length&&("item"===this.kind?this.blocks.push({type:"inline",leaves:this.run}):this.blocks.push({type:this.types[this.types.length-1],leaves:this.run}),this.run=[])}open(e){"item"!==this.kind?(this.flush(),this.types.push(e),this.starts.push(this.blocks.length)):this.needBreak=!0}close(e=!1){if("item"===this.kind)return void(this.needBreak=!0);const t=this.starts[this.starts.length-1];e&&!this.run.length&&this.blocks.length===t&&this.blocks.push({type:this.types[this.types.length-1],leaves:[]}),this.flush(),this.types.length>1&&(this.types.pop(),this.starts.pop())}block(e){this.flush(),this.blocks.push(e),this.needBreak=!1}}function x(e,t,i){for(const r of e)$(r,t,i)}function $(e,t,i){if("text"===e.type)return void function(e,t,i){if(i.pre)return void e.replace(/\r\n?/gu,"\n").split("\n").forEach((e,r)=>{r>0&&t.inline(y("br","",i)),e&&t.inline(y("text",e.replace(/[\t\f]/gu," "),i))});const r=e.replace(/[\t\n\r\f ]+/gu," ");r&&(" "!==r||t.run.length)&&t.inline(y("text",r,i))}(e.value,t,i);const s=e.name;if(o.has(s))return;if("br"===s)return void t.inline(y("br","",i));const c={...i,marks:b(e,i.marks)};if("a"===s){const r=function(e){if("string"!=typeof e)return null;const t=e.trim();if(!t||t.length>2048)return null;const i=t.replace(h,"");if(!i)return null;if(i.startsWith("/")){if(/^\/[/\\]/u.test(i))return null;const e=t.replace(p,"");return/^\/[/\\]/u.test(e)?null:e}const r=/^([a-z][a-z0-9+.-]*):/iu.exec(i)?.[1]?.toLowerCase();if(!r||!n.includes(`${r}:`))return null;let s;try{s=new globalThis.URL(t.replace(p,""))}catch{return null}return s.protocol!==`${r}:`?null:"https:"!==s.protocol||s.hostname?"https:"!==s.protocol&&s.href.length<=s.protocol.length?null:s.href:null}(e.attrs?.href);return void x(e.children,t,r&&!i.href?{...c,href:r}:c)}if(r.includes(s))return t.open(s),x(e.children,t,c),void t.close(!0);if(l.has(s)){const i=_(e,c,s);return void(i.items.length&&t.block(i))}if("blockquote"===s){if("item"===t.kind)return t.open("p"),x(e.children,t,c),void t.close();const i=new w("flow");return x(e.children,i,c),i.flush(),void t.block({type:"blockquote",blocks:i.blocks})}if("li"===s)return t.open("p"),x(e.children,t,c),void t.close();if(!i.paste||"item"===t.kind||"pre"!==s&&"listing"!==s){if(!i.paste||"item"===t.kind||"table"!==s)return a.has(s)?(t.open("p"),x(e.children,t,"pre"===s||"listing"===s?{...c,pre:!0}:c),void t.close()):void x(e.children,t,c);t.block(function(e,t){const i={type:"table",caption:[],rows:[]},r=(e,r)=>{const n=[];for(const i of e.children){if("element"!==i.type||"td"!==i.name&&"th"!==i.name)continue;const e=new w("item");x(i.children,e,{...t,marks:b(i,t.marks)}),e.flush(),n.push({header:"th"===i.name,leaves:T(e.blocks)})}n.length&&i.rows.push({head:r,cells:n})},n=(e,t)=>{for(const i of e.children)"element"===i.type&&"tr"===i.name&&r(i,t)};for(const s of e.children)if("element"===s.type)if("caption"===s.name){const e=new w("item");x(s.children,e,t),e.flush(),i.caption=T(e.blocks)}else"thead"===s.name?n(s,!0):"tbody"===s.name||"tfoot"===s.name?n(s,!1):"tr"===s.name&&r(s,!1);return i}(e,c))}else t.block({type:"pre",text:S(e)})}function S(e){const t=e=>"text"===e.type?e.value:o.has(e.name)?"":"br"===e.name?"\n":e.children.map(t).join("");return e.children.map(t).join("").replace(/\r\n?/gu,"\n").replace(/\u00a0/gu," ").replace(/^\n/u,"").replace(/\s+$/u,"")}function T(e){const t=[],i=e=>{if("inline"===e.type)(r=e.leaves).length&&(t.length&&t.push({kind:"br",strong:!1,em:!1,href:null}),t.push(...r));else for(const t of e.items)t.children.forEach(i);var r};return e.forEach(i),t}function k(e,t){const i=new w("item");return x(e.children,i,t),i.flush(),{children:i.blocks}}function _(e,t,i){const r={type:i,items:[]};let n=null;const s=()=>{n&&(n.flush(),r.items.push({children:n.blocks}),n=null)};for(const i of e.children)if("element"!==i.type||"li"!==i.name){if("element"===i.type&&l.has(i.name)){s();const e=_(i,{...t,marks:b(i,t.marks)},i.name);if(!e.items.length)continue;const n=r.items.at(-1);n?n.children.push(e):r.items.push({children:[e]});continue}("text"!==i.type||i.value.trim())&&("element"===i.type&&o.has(i.name)||(n??=new w("item"),$(i,n,t)))}else s(),r.items.push(k(i,t));return s(),r}const A=" ",F=(e,t)=>e.strong===t.strong&&e.em===t.em&&e.href===t.href;function C(e,t){const i=[];for(const t of e){if("text"===t.kind&&!t.value)continue;const e=i.at(-1);"text"===t.kind&&"text"===e?.kind&&F(e,t)?e.value+=t.value:i.push({...t})}for(let e=0;e<i.length;e+=1){const t=i[e];if("text"!==t.kind)continue;t.value=t.value.replace(/ {2,}/gu,A);const r=i[e-1];t.value.startsWith(A)&&(!r||"br"===r.kind||"text"===r.kind&&r.value.endsWith(A))&&(t.value=t.value.slice(1));const n=i[e+1];!t.value.endsWith(A)||n&&"br"!==n.kind||(t.value=t.value.slice(0,-1))}let r=i.filter(e=>"br"===e.kind||e.value);if("value"===t){for(;"br"===r[0]?.kind;)r.shift();for(;"br"===r.at(-1)?.kind;)r.pop();"text"===r[0]?.kind&&(r[0].value=r[0].value.replace(/^[\s\u00a0]+/u,""));const e=r.at(-1);"text"===e?.kind&&(e.value=e.value.replace(/[\s\u00a0]+$/u,"")),r=r.filter(e=>"br"===e.kind||e.value)}const n=new Map;for(const e of r)e.href&&n.set(e.href,(n.get(e.href)||"")+("text"===e.kind?e.value:"x"));for(const e of r)e.href&&!n.get(e.href).trim()&&(e.href=null);const s=[];for(const e of r){const t=s.at(-1);"text"===e.kind&&"text"===t?.kind&&F(t,e)?t.value+=e.value:s.push(e)}return s}const z=e=>e.some(e=>"text"===e.kind&&""!==e.value.replace(/[\s\u00a0]+/gu,""));function E(e,t){const i=e.items.map(e=>function(e,t){const i=[];for(const r of e.children)if("inline"===r.type){const e=C(r.leaves,t);if(!e.length)continue;const n=i.at(-1);"inline"===n?.type?n.leaves=C([...n.leaves,{kind:"br",strong:!1,em:!1,href:null},...e],t):i.push({type:"inline",leaves:e})}else{const e=E(r,t);if(!e)continue;const n=i.at(-1);n&&n.type===e.type?n.items.push(...e.items):i.push(e)}if("value"===t){const e=i.filter(e=>"inline"!==e.type||z(e.leaves));return e.length?{children:e}:null}return i.length&&"inline"===i[0].type||i.unshift({type:"inline",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}),{children:i}}(e,t)).filter(Boolean);return i.length?{type:e.type,items:i}:null}function q(e,t){const i=[];for(const r of e){let e=null;if("blockquote"===r.type){const i=q(r.blocks,t);i.length?e={type:"blockquote",blocks:i}:"editor"===t&&(e={type:"blockquote",blocks:[{type:"p",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}]})}else if(l.has(r.type))e=E(r,t);else if("pre"===r.type)r.text.trim()&&(e={type:"pre",text:r.text});else if("table"===r.type){const t=r.rows.map(e=>({head:e.head,cells:e.cells.map(e=>({header:e.header,leaves:C(e.leaves,"value")}))})).filter(e=>e.cells.some(e=>z(e.leaves)));t.length&&(e={type:"table",caption:C(r.caption,"value"),rows:t})}else{const i=C(r.leaves,t);"value"===t?z(i)&&(e={type:r.type,leaves:i}):e={type:r.type,leaves:i.length?i:[{kind:"br",strong:!1,em:!1,href:null}]}}if(!e)continue;const n=i.at(-1);n&&l.has(e.type)&&n.type===e.type?n.items.push(...e.items):i.push(e)}return i}function V(e,{mode:t="value",profile:i="html"}={}){if(!s.includes(i))throw new TypeError(`rich_text_profile_unknown: ${i}`);const r=new w("flow");x(e.children??[],r,{marks:{},href:null,pre:!1,paste:"paste"===i}),r.flush();const n=q(r.blocks,t);return"editor"!==t||n.length?n:[{type:"p",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}]}const L=e=>e.replace(/&/gu,"&amp;").replace(/"/gu,"&quot;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/\u00a0/gu,"&nbsp;");function P(e){const t=(e,i)=>{let r="",n=0;const s=["href","strong","em"][i];for(;n<e.length;){const o=s?e[n][s]:null;let a=n+1;for(;a<e.length&&s&&e[a][s]===o;)a+=1;const l=e.slice(n,a);r+=s?"href"===s&&o?`<a href="${L(o)}">${t(l,i+1)}</a>`:"href"!==s&&o?`<${s}>${t(l,i+1)}</${s}>`:t(l,i+1):l.map(e=>"br"===e.kind?"<br>":e.value.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/\u00a0/gu,"&nbsp;")).join(""),n=a}return r};return t(e,0)}function O(e){return`<${e.type}>${e.items.map(e=>`<li>${e.children.map(e=>"inline"===e.type?P(e.leaves):O(e)).join("")}</li>`).join("")}</${e.type}>`}function D(e){return e.map(e=>{if("blockquote"===e.type)return`<blockquote>${D(e.blocks)}</blockquote>`;if(l.has(e.type))return O(e);if("pre"===e.type){return`<p>${P(C(e.text.split("\n").flatMap((e,t)=>[...t?[{kind:"br",strong:!1,em:!1,href:null}]:[],{kind:"text",value:e.replace(/[\t\f]/gu," "),strong:!1,em:!1,href:null}]),"value"))}</p>`}if("table"===e.type){return[{leaves:e.caption},...e.rows.flatMap(e=>e.cells)].filter(e=>z(e.leaves)).map(e=>`<p>${P(e.leaves)}</p>`).join("")}return`<${e.type}>${P(e.leaves)}</${e.type}>`}).join("")}const I=e=>{const t=e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;return"string"==typeof t?t:""};function R(e){const t=I(e);return t?function(e,{mode:t="value",document:i}={}){let r;if(e&&"object"==typeof e&&"number"==typeof e.nodeType)r=v(e);else{const t="string"==typeof e?e:"",n=void 0===i?globalThis.document:i;if(t&&n?.createElement){const e=n.createElement("template");e.innerHTML=t,r=v(e.content)}else r=m(t)}return D(V(r,{mode:t}))}(t,{mode:"value"}):""}function M(e){const t=I(e);return t?function(e){const t=V(m(e),{mode:"value"}),i=e=>e.map(e=>"br"===e.kind?"\n":e.value).join(""),r=e=>e.items.map(e=>e.children.map(e=>"inline"===e.type?i(e.leaves):r(e)).join("\n")).join("\n"),n=e=>e.map(e=>"blockquote"===e.type?n(e.blocks):l.has(e.type)?r(e):i(e.leaves)).join("\n\n");return n(t)}(t).replace(/\s+/gu," ").trim():""}},e5483002f3ea(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{oX:()=>ct,z4:()=>He});var n=i("2a080a730149"),s=i("073f05ff1a81"),o=i("5961360f41f4"),a=i("43090d1c8307"),l=i("fc654eb7fab0"),c=i("9ce1a42b2a85"),u=i("dd6973f77245"),d=i("eb06ad68f8d3"),p=e([n,s,a]);[n,s,a]=p.then?(await p)():p;function h(e){return String(e?.size||"").trim()||"1"}function f(e,t){const i=t.getFilterControlValue(e.key);return n.html`
1
+ (()=>{"use strict";var e={e577837dd70a(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{Yq:()=>l});var r=n("15b4e93ff6ed"),s=e([r]),o=s.then?(await s)():s;r=o[0];function a(e){return"short"===e||"medium"===e||"long"===e||"full"===e}function l(e,{date:t="medium",time:n=null,intl:i=null,gap:s="",...o}={}){const l=(0,r.ay)(e);if(!l)return s;let c=i;return c||(c={},a(t)&&(c.dateStyle=t),a(n)&&(c.timeStyle=n),c.dateStyle||c.timeStyle||(c.dateStyle="medium")),(0,r.Qz)("DateTimeFormat",(0,r.OE)(o),c).format(l)}i()}catch(c){i(c)}})},"15b4e93ff6ed"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{OE:()=>a,Qz:()=>u,ay:()=>l});var r=n("43090d1c8307"),s=e([r]),o=s.then?(await s)():s;r=o[0];function a({locale:e,node:t}={}){return String(e||"").trim()||(0,r.pageLocale)(t)}function l(e){if(null==e||""===e)return null;const t=e instanceof Date?new Date(e.getTime()):new Date("string"==typeof e&&/^\d+$/u.test(e)?Number(e):e);return Number.isNaN(t.getTime())?null:t}function c(){const e="undefined"!=typeof globalThis?globalThis:{};return e.__sfFormat||(e.__sfFormat={formatters:new Map}),e.__sfFormat.formatters}function u(e,t,n){const i=`${e}|${t}|${JSON.stringify(n)}`,r=c();if(r.has(i))return r.get(i);const s=Intl[e];let o;try{o=new s(t||void 0,n)}catch{try{o=new s(void 0,n)}catch{o=new s(t||void 0,"NumberFormat"===e?{maximumFractionDigits:2}:{})}}return r.size>=256&&r.delete(r.keys().next().value),r.set(i,o),o}i()}catch(d){i(d)}})},"1b42c5117087"(e,t,n){const i=Object.freeze(["folder","folder_open","topic","home","dashboard","apartment","store","storefront","business_center","work","badge","person","group","groups","account_circle","manage_accounts","supervisor_account","contacts","school","menu_book","assignment","task","description","article","note_alt","edit_note","draft","receipt","receipt_long","request_quote","inventory_2","category","label","sell","local_offer","shopping_cart","shopping_bag","payments","savings","credit_card","account_balance","calculate","percent","trending_up","analytics","insights","monitoring","bar_chart","pie_chart","table_chart","schedule","event","today","calendar_month","date_range","history","alarm","timer","update","hourglass_top","mail","outgoing_mail","chat","forum","sms","call","phone_in_talk","contact_support","campaign","notifications","language","public","place","map","location_on","travel_explore","flight","local_shipping","route","directions","settings","tune","build","construction","handyman","code","terminal","data_object","api","bug_report","database","storage","cloud","backup","sync","folder_zip","upload_file","download","attach_file","link","lock","lock_open","shield","verified_user","key","admin_panel_settings","policy","gavel","fingerprint","visibility","palette","format_paint","image","photo_library","collections","movie","play_circle","mic","headphones","brush"]);"undefined"!=typeof globalThis&&(globalThis.SF=globalThis.SF||{},globalThis.SF.icons=globalThis.SF.icons||{},globalThis.SF.icons.choices||(globalThis.SF.icons.choices=i));n.d(t,["x",0,i])},"9ce1a42b2a85"(e,t,n){n.d(t,{AC:()=>o,MC:()=>d,SB:()=>u,cy:()=>l,d2:()=>a});const i=/^(\d{4}-\d{2}-\d{2})(?:[T ](\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/u,r=/^\d{4}-\d{2}-\d{2}$/u;function s(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e}function o(e){const t=s(e);if(null==t||""===t)return{raw:t??null,known:!0,date:"",time:"",rest:"",zone:""};const n="string"==typeof t?t.trim().match(i):null;return n?{raw:t,known:!0,date:n[1],time:n[2]?`${n[2]}:${n[3]}`:"",rest:n[4]||"",zone:n[5]||""}:{raw:t,known:!1,date:"",time:"",rest:"",zone:""}}function a(e){const t=String(e??"").trim().replace(/[_\s]/gu,"");if(""===t||":"===t)return"";const n=t.match(/^(\d{1,2})[:.]?(\d{2})$/u);if(!n)return null;const i=Number(n[1]),r=Number(n[2]);return i>23||r>59?null:`${String(i).padStart(2,"0")}:${n[2]}`}function l(e,t){const n=String(t?.date??"").trim(),i=a(t?.time);if(null===i)return{error:"timeInvalid"};if(!n&&!i)return{value:null};if(!r.test(n))return{error:n?"dateInvalid":"dateMissing"};if(!i)return{error:"timeMissing"};const s=e?.known?e:null;if(s&&s.date===n&&s.time===i)return{value:s.raw};return{value:`${n}T${i}${s&&s.time===i?s.rest:":00"}${s&&s.time?s.zone:""}`}}const c=/^(\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?$/u;function u(e){const t=s(e);if(null==t||""===t)return{raw:t??null,known:!0,time:"",rest:""};const n="string"==typeof t?t.trim().match(c):null;return n&&null!==a(`${n[1]}:${n[2]}`)?{raw:t,known:!0,time:`${n[1]}:${n[2]}`,rest:n[3]||""}:{raw:t,known:!1,time:"",rest:""}}function d(e,t){const n=a(t);if(null===n)return{error:"timeInvalid"};if(!n)return{value:null};const i=e?.known?e:null;return i&&i.time===n?{value:i.raw}:{value:i?.rest?`${n}:00`:n}}},eb06ad68f8d3(e,t,n){n.d(t,{b:()=>D,j:()=>M});Object.freeze(["p","h2","h3","h4","strong","em","a","ul","ol","li","blockquote","br"]);const i=Object.freeze(["p","h2","h3","h4"]),r=Object.freeze(["https:","mailto:","tel:"]),s=Object.freeze(["html","paste"]),o=(Object.freeze(["pre","table"]),new Set(["script","style","template","head","title","meta","link","base","noscript","iframe","frame","frameset","noembed","noframes","object","embed","applet","svg","math","canvas","video","audio","img","picture","source","track","input","select","textarea","xmp","plaintext"])),a=new Set(["address","article","aside","body","caption","center","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h5","h6","header","hgroup","hr","html","legend","listing","main","menu","nav","optgroup","option","pre","section","summary","table","tbody","td","tfoot","th","thead","tr"]),l=new Set(["ul","ol"]),c=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),u=new Set(["script","style","textarea","title","xmp","iframe","noembed","noframes","noscript"]),d=new Set(["td","th","table","caption","button"]),p=/[\u0000-\u001f\u007f-\u009f]/gu,h=/[\u0000- \u007f-\u009f\u00a0\u1680\u2000-\u200b\u2028\u2029\u202f\u205f\u3000\ufeff]/gu;const f={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",shy:"­",hellip:"…",mdash:"—",ndash:"–",minus:"−",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",bull:"•",middot:"·",copy:"©",reg:"®",trade:"™",deg:"°",times:"×",divide:"÷",plusmn:"±",euro:"€",pound:"£",yen:"¥",cent:"¢",sect:"§",para:"¶",thinsp:" ",ensp:" ",emsp:" ",zwj:"‍",zwnj:"‌",larr:"←",rarr:"→",uarr:"↑",darr:"↓",numero:"№",prime:"′",Prime:"″"};function g(e){return String(e).replace(/&(#x[0-9a-f]+|#[0-9]+|[a-z][a-z0-9]*);?/giu,(e,t)=>{if("#"===t[0]){const e="x"===t[1]||"X"===t[1]?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return!Number.isFinite(e)||e<=0||e>1114111||e>=55296&&e<=57343?"�":String.fromCodePoint(e)}return Object.hasOwn(f,t)&&e.endsWith(";")?f[t]:e})}function m(e){const t="string"==typeof e?e:"",n={type:"element",name:"#root",attrs:{},children:[]},r=[n],s=()=>r[r.length-1],o=e=>s().children.push(e),p=e=>{if(!e)return;const t=s().children.at(-1);"text"===t?.type?t.value+=e:o({type:"text",value:e})},h=(e,t=null)=>{for(let n=r.length-1;n>0;n-=1){const i=r[n].name;if(t&&t.has(i))return!1;if(i===e)return r.length=n,!0}return!1};let f=0;const m=t.length;for(;f<m;){const e=t.indexOf("<",f);if(e<0){p(g(t.slice(f)));break}if(e>f&&p(g(t.slice(f,e))),f=e,t.startsWith("\x3c!--",f)){const e=t.indexOf("--\x3e",f+4);f=e<0?m:e+3;continue}const n=t[f+1]??"";if("!"===n||"?"===n){const e=t.indexOf(">",f+2);f=e<0?m:e+1;continue}if("/"===n){const e=/^<\/([a-z][a-z0-9-]*)[^>]*>?/iu.exec(t.slice(f));if(!e){const e=t.indexOf(">",f+2);f=e<0?m:e+1;continue}f+=e[0].length;const n=e[1].toLowerCase();"br"===n?o({type:"element",name:"br",attrs:{},children:[]}):"p"!==n||h("p",d)?h(n):o({type:"element",name:"p",attrs:{},children:[]});continue}const s=/^<([a-z][a-z0-9-]*)/iu.exec(t.slice(f));if(!s){p("<"),f+=1;continue}f+=s[0].length;const v=s[1].toLowerCase(),y={};let b=!1;for(;f<m;){const e=/^[\s/]+/u.exec(t.slice(f));if(e){e[0].includes("/")&&">"===t[f+e[0].length]&&(b=!0),f+=e[0].length;continue}if(">"===t[f]){f+=1;break}const n=/^([^\s/>"'=][^\s/>"'=]*)(?:\s*=\s*(?:"([^"]*)"?|'([^']*)'?|([^\s>]*)))?/u.exec(t.slice(f));if(!n){f+=1;continue}f+=n[0].length;const i=n[1].toLowerCase();Object.hasOwn(y,i)||(y[i]=g(n[2]??n[3]??n[4]??""))}const w={type:"element",name:v,attrs:y,children:[]};if("li"===v&&h("li",l),(i.includes(v)||l.has(v)||"blockquote"===v||a.has(v))&&h("p",d),o(w),"plaintext"===v){f=m;break}if(u.has(v)){const e=new RegExp(`</${v}[\\s/>]`,"iu").exec(t.slice(f)),n=e?f+e.index:m;"textarea"===v||"title"===v?w.children.push({type:"text",value:g(t.slice(f,n))}):w.children.push({type:"text",value:t.slice(f,n)});const i=e?t.indexOf(">",n):-1;f=i<0?m:i+1;continue}c.has(v)||b||r.push(w)}return n}function v(e){const t=e=>{if(3===e.nodeType)return{type:"text",value:e.data};if(11===e.nodeType)return{type:"element",name:"#root",attrs:{},children:[...e.childNodes].map(t).filter(Boolean)};if(1!==e.nodeType)return null;if(e.namespaceURI&&"http://www.w3.org/1999/xhtml"!==e.namespaceURI)return null;const n=e.localName;if(o.has(n))return null;const i={},r=e.getAttribute("href");null!==r&&(i.href=r);const s=e.getAttribute("style");null!==s&&(i.style=s);return{type:"element",name:n,attrs:i,children:"template"===n?[]:[...e.childNodes].map(t).filter(Boolean)}},n=t(e);return n&&"element"===n.type?{...n,name:"#root"}:{type:"element",name:"#root",attrs:{},children:n?[n]:[]}}function y(e,t){const n={...t};"strong"!==e.name&&"b"!==e.name||(n.strong=!0),"em"!==e.name&&"i"!==e.name||(n.em=!0);const i=function(e){const t={};if(!e)return t;const n=/(?:^|;)\s*font-weight\s*:\s*([^;!]+)/iu.exec(e)?.[1]?.trim().toLowerCase();n&&("bold"===n||"bolder"===n||Number(n)>=600?t.strong=!0:("normal"===n||"lighter"===n||Number(n)<600)&&(t.strong=!1));const i=/(?:^|;)\s*font-style\s*:\s*([^;!]+)/iu.exec(e)?.[1]?.trim().toLowerCase();return i&&("italic"===i||i.startsWith("oblique")?t.em=!0:"normal"===i&&(t.em=!1)),t}(e.attrs?.style);return void 0!==i.strong&&(n.strong=i.strong),void 0!==i.em&&(n.em=i.em),n}const b=(e,t,n)=>({kind:e,value:t,strong:Boolean(n.marks.strong),em:Boolean(n.marks.em),href:n.href||null});class w{constructor(e){this.kind=e,this.blocks=[],this.run=[],this.types=["p"],this.starts=[0],this.needBreak=!1}inline(e){"item"===this.kind&&this.needBreak&&this.run.length>0&&("text"!==e.kind||e.value.trim())&&(this.run.push({kind:"br",strong:!1,em:!1,href:null}),this.needBreak=!1),this.run.push(e)}flush(){this.run.length&&("item"===this.kind?this.blocks.push({type:"inline",leaves:this.run}):this.blocks.push({type:this.types[this.types.length-1],leaves:this.run}),this.run=[])}open(e){"item"!==this.kind?(this.flush(),this.types.push(e),this.starts.push(this.blocks.length)):this.needBreak=!0}close(e=!1){if("item"===this.kind)return void(this.needBreak=!0);const t=this.starts[this.starts.length-1];e&&!this.run.length&&this.blocks.length===t&&this.blocks.push({type:this.types[this.types.length-1],leaves:[]}),this.flush(),this.types.length>1&&(this.types.pop(),this.starts.pop())}block(e){this.flush(),this.blocks.push(e),this.needBreak=!1}}function x(e,t,n){for(const i of e)$(i,t,n)}function $(e,t,n){if("text"===e.type)return void function(e,t,n){if(n.pre)return void e.replace(/\r\n?/gu,"\n").split("\n").forEach((e,i)=>{i>0&&t.inline(b("br","",n)),e&&t.inline(b("text",e.replace(/[\t\f]/gu," "),n))});const i=e.replace(/[\t\n\r\f ]+/gu," ");i&&(" "!==i||t.run.length)&&t.inline(b("text",i,n))}(e.value,t,n);const s=e.name;if(o.has(s))return;if("br"===s)return void t.inline(b("br","",n));const c={...n,marks:y(e,n.marks)};if("a"===s){const i=function(e){if("string"!=typeof e)return null;const t=e.trim();if(!t||t.length>2048)return null;const n=t.replace(h,"");if(!n)return null;if(n.startsWith("/")){if(/^\/[/\\]/u.test(n))return null;const e=t.replace(p,"");return/^\/[/\\]/u.test(e)?null:e}const i=/^([a-z][a-z0-9+.-]*):/iu.exec(n)?.[1]?.toLowerCase();if(!i||!r.includes(`${i}:`))return null;let s;try{s=new globalThis.URL(t.replace(p,""))}catch{return null}return s.protocol!==`${i}:`?null:"https:"!==s.protocol||s.hostname?"https:"!==s.protocol&&s.href.length<=s.protocol.length?null:s.href:null}(e.attrs?.href);return void x(e.children,t,i&&!n.href?{...c,href:i}:c)}if(i.includes(s))return t.open(s),x(e.children,t,c),void t.close(!0);if(l.has(s)){const n=_(e,c,s);return void(n.items.length&&t.block(n))}if("blockquote"===s){if("item"===t.kind)return t.open("p"),x(e.children,t,c),void t.close();const n=new w("flow");return x(e.children,n,c),n.flush(),void t.block({type:"blockquote",blocks:n.blocks})}if("li"===s)return t.open("p"),x(e.children,t,c),void t.close();if(!n.paste||"item"===t.kind||"pre"!==s&&"listing"!==s){if(!n.paste||"item"===t.kind||"table"!==s)return a.has(s)?(t.open("p"),x(e.children,t,"pre"===s||"listing"===s?{...c,pre:!0}:c),void t.close()):void x(e.children,t,c);t.block(function(e,t){const n={type:"table",caption:[],rows:[]},i=(e,i)=>{const r=[];for(const n of e.children){if("element"!==n.type||"td"!==n.name&&"th"!==n.name)continue;const e=new w("item");x(n.children,e,{...t,marks:y(n,t.marks)}),e.flush(),r.push({header:"th"===n.name,leaves:S(e.blocks)})}r.length&&n.rows.push({head:i,cells:r})},r=(e,t)=>{for(const n of e.children)"element"===n.type&&"tr"===n.name&&i(n,t)};for(const s of e.children)if("element"===s.type)if("caption"===s.name){const e=new w("item");x(s.children,e,t),e.flush(),n.caption=S(e.blocks)}else"thead"===s.name?r(s,!0):"tbody"===s.name||"tfoot"===s.name?r(s,!1):"tr"===s.name&&i(s,!1);return n}(e,c))}else t.block({type:"pre",text:k(e)})}function k(e){const t=e=>"text"===e.type?e.value:o.has(e.name)?"":"br"===e.name?"\n":e.children.map(t).join("");return e.children.map(t).join("").replace(/\r\n?/gu,"\n").replace(/\u00a0/gu," ").replace(/^\n/u,"").replace(/\s+$/u,"")}function S(e){const t=[],n=e=>{if("inline"===e.type)(i=e.leaves).length&&(t.length&&t.push({kind:"br",strong:!1,em:!1,href:null}),t.push(...i));else for(const t of e.items)t.children.forEach(n);var i};return e.forEach(n),t}function T(e,t){const n=new w("item");return x(e.children,n,t),n.flush(),{children:n.blocks}}function _(e,t,n){const i={type:n,items:[]};let r=null;const s=()=>{r&&(r.flush(),i.items.push({children:r.blocks}),r=null)};for(const n of e.children)if("element"!==n.type||"li"!==n.name){if("element"===n.type&&l.has(n.name)){s();const e=_(n,{...t,marks:y(n,t.marks)},n.name);if(!e.items.length)continue;const r=i.items.at(-1);r?r.children.push(e):i.items.push({children:[e]});continue}("text"!==n.type||n.value.trim())&&("element"===n.type&&o.has(n.name)||(r??=new w("item"),$(n,r,t)))}else s(),i.items.push(T(n,t));return s(),i}const A=" ",F=(e,t)=>e.strong===t.strong&&e.em===t.em&&e.href===t.href;function C(e,t){const n=[];for(const t of e){if("text"===t.kind&&!t.value)continue;const e=n.at(-1);"text"===t.kind&&"text"===e?.kind&&F(e,t)?e.value+=t.value:n.push({...t})}for(let e=0;e<n.length;e+=1){const t=n[e];if("text"!==t.kind)continue;t.value=t.value.replace(/ {2,}/gu,A);const i=n[e-1];t.value.startsWith(A)&&(!i||"br"===i.kind||"text"===i.kind&&i.value.endsWith(A))&&(t.value=t.value.slice(1));const r=n[e+1];!t.value.endsWith(A)||r&&"br"!==r.kind||(t.value=t.value.slice(0,-1))}let i=n.filter(e=>"br"===e.kind||e.value);if("value"===t){for(;"br"===i[0]?.kind;)i.shift();for(;"br"===i.at(-1)?.kind;)i.pop();"text"===i[0]?.kind&&(i[0].value=i[0].value.replace(/^[\s\u00a0]+/u,""));const e=i.at(-1);"text"===e?.kind&&(e.value=e.value.replace(/[\s\u00a0]+$/u,"")),i=i.filter(e=>"br"===e.kind||e.value)}const r=new Map;for(const e of i)e.href&&r.set(e.href,(r.get(e.href)||"")+("text"===e.kind?e.value:"x"));for(const e of i)e.href&&!r.get(e.href).trim()&&(e.href=null);const s=[];for(const e of i){const t=s.at(-1);"text"===e.kind&&"text"===t?.kind&&F(t,e)?t.value+=e.value:s.push(e)}return s}const z=e=>e.some(e=>"text"===e.kind&&""!==e.value.replace(/[\s\u00a0]+/gu,""));function E(e,t){const n=e.items.map(e=>function(e,t){const n=[];for(const i of e.children)if("inline"===i.type){const e=C(i.leaves,t);if(!e.length)continue;const r=n.at(-1);"inline"===r?.type?r.leaves=C([...r.leaves,{kind:"br",strong:!1,em:!1,href:null},...e],t):n.push({type:"inline",leaves:e})}else{const e=E(i,t);if(!e)continue;const r=n.at(-1);r&&r.type===e.type?r.items.push(...e.items):n.push(e)}if("value"===t){const e=n.filter(e=>"inline"!==e.type||z(e.leaves));return e.length?{children:e}:null}return n.length&&"inline"===n[0].type||n.unshift({type:"inline",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}),{children:n}}(e,t)).filter(Boolean);return n.length?{type:e.type,items:n}:null}function q(e,t){const n=[];for(const i of e){let e=null;if("blockquote"===i.type){const n=q(i.blocks,t);n.length?e={type:"blockquote",blocks:n}:"editor"===t&&(e={type:"blockquote",blocks:[{type:"p",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}]})}else if(l.has(i.type))e=E(i,t);else if("pre"===i.type)i.text.trim()&&(e={type:"pre",text:i.text});else if("table"===i.type){const t=i.rows.map(e=>({head:e.head,cells:e.cells.map(e=>({header:e.header,leaves:C(e.leaves,"value")}))})).filter(e=>e.cells.some(e=>z(e.leaves)));t.length&&(e={type:"table",caption:C(i.caption,"value"),rows:t})}else{const n=C(i.leaves,t);"value"===t?z(n)&&(e={type:i.type,leaves:n}):e={type:i.type,leaves:n.length?n:[{kind:"br",strong:!1,em:!1,href:null}]}}if(!e)continue;const r=n.at(-1);r&&l.has(e.type)&&r.type===e.type?r.items.push(...e.items):n.push(e)}return n}function L(e,{mode:t="value",profile:n="html"}={}){if(!s.includes(n))throw new TypeError(`rich_text_profile_unknown: ${n}`);const i=new w("flow");x(e.children??[],i,{marks:{},href:null,pre:!1,paste:"paste"===n}),i.flush();const r=q(i.blocks,t);return"editor"!==t||r.length?r:[{type:"p",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}]}const O=e=>e.replace(/&/gu,"&amp;").replace(/"/gu,"&quot;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/\u00a0/gu,"&nbsp;");function P(e){const t=(e,n)=>{let i="",r=0;const s=["href","strong","em"][n];for(;r<e.length;){const o=s?e[r][s]:null;let a=r+1;for(;a<e.length&&s&&e[a][s]===o;)a+=1;const l=e.slice(r,a);i+=s?"href"===s&&o?`<a href="${O(o)}">${t(l,n+1)}</a>`:"href"!==s&&o?`<${s}>${t(l,n+1)}</${s}>`:t(l,n+1):l.map(e=>"br"===e.kind?"<br>":e.value.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/\u00a0/gu,"&nbsp;")).join(""),r=a}return i};return t(e,0)}function V(e){return`<${e.type}>${e.items.map(e=>`<li>${e.children.map(e=>"inline"===e.type?P(e.leaves):V(e)).join("")}</li>`).join("")}</${e.type}>`}function I(e){return e.map(e=>{if("blockquote"===e.type)return`<blockquote>${I(e.blocks)}</blockquote>`;if(l.has(e.type))return V(e);if("pre"===e.type){return`<p>${P(C(e.text.split("\n").flatMap((e,t)=>[...t?[{kind:"br",strong:!1,em:!1,href:null}]:[],{kind:"text",value:e.replace(/[\t\f]/gu," "),strong:!1,em:!1,href:null}]),"value"))}</p>`}if("table"===e.type){return[{leaves:e.caption},...e.rows.flatMap(e=>e.cells)].filter(e=>z(e.leaves)).map(e=>`<p>${P(e.leaves)}</p>`).join("")}return`<${e.type}>${P(e.leaves)}</${e.type}>`}).join("")}const R=e=>{const t=e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;return"string"==typeof t?t:""};function D(e){const t=R(e);return t?function(e,{mode:t="value",document:n}={}){let i;if(e&&"object"==typeof e&&"number"==typeof e.nodeType)i=v(e);else{const t="string"==typeof e?e:"",r=void 0===n?globalThis.document:n;if(t&&r?.createElement){const e=r.createElement("template");e.innerHTML=t,i=v(e.content)}else i=m(t)}return I(L(i,{mode:t}))}(t,{mode:"value"}):""}function M(e){const t=R(e);return t?function(e){const t=L(m(e),{mode:"value"}),n=e=>e.map(e=>"br"===e.kind?"\n":e.value).join(""),i=e=>e.items.map(e=>e.children.map(e=>"inline"===e.type?n(e.leaves):i(e)).join("\n")).join("\n"),r=e=>e.map(e=>"blockquote"===e.type?r(e.blocks):l.has(e.type)?i(e):n(e.leaves)).join("\n\n");return r(t)}(t).replace(/\s+/gu," ").trim():""}},e5483002f3ea(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{oX:()=>ct,z4:()=>We});var r=n("2a080a730149"),s=n("073f05ff1a81"),o=n("5961360f41f4"),a=n("43090d1c8307"),l=n("fc654eb7fab0"),c=n("9ce1a42b2a85"),u=n("dd6973f77245"),d=n("eb06ad68f8d3"),p=e([r,s,a]);[r,s,a]=p.then?(await p)():p;function h(e){return String(e?.size||"").trim()||"1"}function f(e,t){const n=t.getFilterControlValue(e.key);return r.html`
2
2
  <sf-input
3
3
  size=${h(t)}
4
4
  appearance="filled"
5
5
  placeholder="${Pe(t,"containsText")}"
6
- value="${i.value||""}"
6
+ value="${n.value||""}"
7
7
  name="sf_filter_${e.key||"text"}"
8
- @change=${r=>{t.patchTempFilterValue(e.key,{value:r.target?.value||"",operator:i.operator||e.filter?.defaultOperator||"contains"})}}
8
+ @change=${i=>{t.patchTempFilterValue(e.key,{value:i.target?.value||"",operator:n.operator||e.filter?.defaultOperator||"contains"})}}
9
9
  ></sf-input>
10
- `}function g(e,t){const i=t.getFilterControlValue(e.key),r=e.filter?.operators||["eq"],s=i.operator||e.filter?.defaultOperator||r[0],o="between"===s,a=o?i.value:Array.isArray(i.value)?i.value[0]:i.value;return n.html`
10
+ `}function g(e,t){const n=t.getFilterControlValue(e.key),i=e.filter?.operators||["eq"],s=n.operator||e.filter?.defaultOperator||i[0],o="between"===s,a=o?n.value:Array.isArray(n.value)?n.value[0]:n.value;return r.html`
11
11
  <div class="flex gap-1/3 flex-col">
12
12
  <div class="sf-filter-operator-range flex gap-1/3 items-cross-center">
13
13
  <sf-slider-range
@@ -18,7 +18,7 @@
18
18
  max="100"
19
19
  multiple=${String(o)}
20
20
  .value=${a}
21
- @onSliderEnd=${i=>{t.patchTempFilterValue(e.key,{value:o?i.detail.values||[]:i.detail.value,operator:s})}}
21
+ @onSliderEnd=${n=>{t.patchTempFilterValue(e.key,{value:o?n.detail.values||[]:n.detail.value,operator:s})}}
22
22
  ></sf-slider-range>
23
23
  </div>
24
24
  <sf-dropdown
@@ -28,9 +28,9 @@
28
28
  placeholder="${Pe(t,"operator")}"
29
29
  root-class="flex-1"
30
30
  search="false"
31
- @change=${i=>{const r=i.detail?.values?.[0]||i.detail?.value||s;t.patchTempFilterValue(e.key,{operator:r})}}
31
+ @change=${n=>{const i=n.detail?.values?.[0]||n.detail?.value||s;t.patchTempFilterValue(e.key,{operator:i})}}
32
32
  >
33
- ${r.map(e=>n.html`
33
+ ${i.map(e=>r.html`
34
34
  <sf-list-item
35
35
  kind="text"
36
36
  size=${h(t)}
@@ -41,7 +41,7 @@
41
41
  `)}
42
42
  </sf-dropdown>
43
43
  </div>
44
- `}function m(e,t){const i=t.getFilterControlValue(e.key),r=e.filter?.operators||["eq"],s=i.operator||e.filter?.defaultOperator||r[0],o="between"===s,a=i.value,l=Array.isArray(a)?a:[a||"",""],c=(i,r)=>{if(!o)return void t.patchTempFilterValue(e.key,{value:r||"",operator:s});const n=[...l];n[i]=r||"",t.patchTempFilterValue(e.key,{value:n,operator:s})};return n.html`
44
+ `}function m(e,t){const n=t.getFilterControlValue(e.key),i=e.filter?.operators||["eq"],s=n.operator||e.filter?.defaultOperator||i[0],o="between"===s,a=n.value,l=Array.isArray(a)?a:[a||"",""],c=(n,i)=>{if(!o)return void t.patchTempFilterValue(e.key,{value:i||"",operator:s});const r=[...l];r[n]=i||"",t.patchTempFilterValue(e.key,{value:r,operator:s})};return r.html`
45
45
  <div class="flex gap-1/3 flex-col">
46
46
  <div class="sf-filter-operator-inputs flex gap-1/3 items-cross-center">
47
47
  <sf-input
@@ -53,7 +53,7 @@
53
53
  name="sf_filter_${e.key||"number"}"
54
54
  @change=${e=>{c(0,e.target?.value)}}
55
55
  ></sf-input>
56
- ${o?n.html`
56
+ ${o?r.html`
57
57
  <sf-input
58
58
  size=${h(t)}
59
59
  appearance="bordered"
@@ -62,7 +62,7 @@
62
62
  value="${l[1]||""}"
63
63
  name="sf_filter_${e.key||"number"}_second"
64
64
  @change=${e=>{c(1,e.target?.value)}}
65
- ></sf-input>`:n.nothing}
65
+ ></sf-input>`:r.nothing}
66
66
  </div>
67
67
  <sf-dropdown
68
68
  size=${h(t)}
@@ -71,9 +71,9 @@
71
71
  placeholder="${Pe(t,"operator")}"
72
72
  root-class="flex-1"
73
73
  search="false"
74
- @change=${i=>{const r=i.detail?.values?.[0]||i.detail?.value||s;t.patchTempFilterValue(e.key,{operator:r})}}
74
+ @change=${n=>{const i=n.detail?.values?.[0]||n.detail?.value||s;t.patchTempFilterValue(e.key,{operator:i})}}
75
75
  >
76
- ${r.map(e=>n.html`
76
+ ${i.map(e=>r.html`
77
77
  <sf-list-item
78
78
  kind="text"
79
79
  size=${h(t)}
@@ -84,14 +84,14 @@
84
84
  `)}
85
85
  </sf-dropdown>
86
86
  </div>
87
- `}function v(e,t){const i=t.getFilterControlValue(e.key),r=e.filter?.operators||["eq"],s=i.operator||e.filter?.defaultOperator||r[0],o="between"===s,a=o&&Array.isArray(i.value)?i.value:o?["",""]:i.value||"";return n.html`
87
+ `}function v(e,t){const n=t.getFilterControlValue(e.key),i=e.filter?.operators||["eq"],s=n.operator||e.filter?.defaultOperator||i[0],o="between"===s,a=o&&Array.isArray(n.value)?n.value:o?["",""]:n.value||"";return r.html`
88
88
  <div class="flex flex-col gap-1/3">
89
89
  <sf-input-date
90
90
  .value=${a}
91
91
  ?range=${o}
92
92
  name="sf_filter_${e.key||"date"}"
93
93
  locale="ru-Ru"
94
- @change=${i=>{t.patchTempFilterValue(e.key,{value:i.detail.value,operator:s})}}
94
+ @change=${n=>{t.patchTempFilterValue(e.key,{value:n.detail.value,operator:s})}}
95
95
  ></sf-input-date>
96
96
  <sf-dropdown
97
97
  size=${h(t)}
@@ -100,9 +100,9 @@
100
100
  placeholder="${Pe(t,"operator")}"
101
101
  root-class="flex-1"
102
102
  search="false"
103
- @change=${i=>{const r=i.detail?.values?.[0]||i.detail?.value||s;t.patchTempFilterValue(e.key,{operator:r})}}
103
+ @change=${n=>{const i=n.detail?.values?.[0]||n.detail?.value||s;t.patchTempFilterValue(e.key,{operator:i})}}
104
104
  >
105
- ${r.map(e=>n.html`
105
+ ${i.map(e=>r.html`
106
106
  <sf-list-item
107
107
  kind="text"
108
108
  size=${h(t)}
@@ -113,65 +113,65 @@
113
113
  `)}
114
114
  </sf-dropdown>
115
115
  </div>
116
- `}function b(e,t){const i=t.getEndpointFilterPage(e),r=t.getVisibleFilterOptions(e),s=t.getFilterControlValue(e.key),o=t.getFilterOptionSearch(e.key),a=new Set(s.values||[]);return n.html`
116
+ `}function y(e,t){const n=t.getEndpointFilterPage(e),i=t.getVisibleFilterOptions(e),s=t.getFilterControlValue(e.key),o=t.getFilterOptionSearch(e.key),a=new Set(s.values||[]);return r.html`
117
117
  <div class="flex flex-col gap-1/2 overflow-x-hidden">
118
- ${!e.filter?.searchable||i&&!i.searchable?"":n.html`
118
+ ${!e.filter?.searchable||n&&!n.searchable?"":r.html`
119
119
  <sf-input
120
120
  size=${h(t)}
121
121
  appearance="filled"
122
122
  placeholder="${Pe(t,"searchInList")}"
123
123
  value="${o}"
124
124
  name="sf_filter_${e.key||"list"}_search"
125
- @input=${i=>{t.patchTempFilterOptionSearch(e.key,i.target?.value||"")}}
126
- @change=${i=>{t.patchTempFilterOptionSearch(e.key,i.target?.value||"")}}
125
+ @input=${n=>{t.patchTempFilterOptionSearch(e.key,n.target?.value||"")}}
126
+ @change=${n=>{t.patchTempFilterOptionSearch(e.key,n.target?.value||"")}}
127
127
  ></sf-input>
128
128
  `}
129
129
  <div class="flex flex-col gap-1/2 overflow-x-hidden" data-size="4.5">
130
- ${r.map(i=>t.renderFilterOption(e,i,a))}
130
+ ${i.map(n=>t.renderFilterOption(e,n,a))}
131
131
  </div>
132
- ${r.length||"loading"===i?.status||"error"===i?.status?"":n.html`
132
+ ${i.length||"loading"===n?.status||"error"===n?.status?"":r.html`
133
133
  <!-- A list with nothing in it says why, in one line, as every
134
134
  list does (simai.interaction-rules, five states). -->
135
135
  <sf-empty-state layout="inline" size="1/2" kind=${o?"nothing-found":"no-data"}></sf-empty-state>`}
136
- ${i?n.html`
136
+ ${n?r.html`
137
137
  <div role="status" aria-live="polite" class="sf-text-1">
138
- ${"loading"===i.status?Pe(t,"loadingOptions"):""}
138
+ ${"loading"===n.status?Pe(t,"loadingOptions"):""}
139
139
  </div>
140
- ${"error"===i.status?n.html`<sf-empty-state layout="inline" size="1/2" kind="error" text=${Pe(t,"optionsError")}
141
- @sf-empty-state-action=${i=>{"retry"===i.detail?.id&&t.loadEndpointFilterPage(e,null,o)}}></sf-empty-state>`:""}
142
- ${i.nextCursor&&"error"!==i.status?n.html`<sf-button appearance="outline" size=${h(t)} text="${Pe(t,"loadMore")}"
143
- ?disabled=${"loading"===i.status}
144
- @click=${()=>t.loadEndpointFilterPage(e,i.nextCursor,o)}></sf-button>`:""}
140
+ ${"error"===n.status?r.html`<sf-empty-state layout="inline" size="1/2" kind="error" text=${Pe(t,"optionsError")}
141
+ @sf-empty-state-action=${n=>{"retry"===n.detail?.id&&t.loadEndpointFilterPage(e,null,o)}}></sf-empty-state>`:""}
142
+ ${n.nextCursor&&"error"!==n.status?r.html`<sf-button appearance="outline" size=${h(t)} text="${Pe(t,"loadMore")}"
143
+ ?disabled=${"loading"===n.status}
144
+ @click=${()=>t.loadEndpointFilterPage(e,n.nextCursor,o)}></sf-button>`:""}
145
145
  `:""}
146
146
  </div>
147
- `}function y(e,t){return b(e,t)}function w(e,t){const i=e.filter?.options??["image","document","archive","other"].map(e=>({value:e,label:Pe(t,`fileKind_${e}`)}));return b({...e,filter:{...e.filter||{},options:i,defaultOperator:e.filter?.defaultOperator??"in"}},t)}function x(e,t){const i=e.filter?.options??(Array.isArray(e.swatches)?e.swatches:[]).map(e=>"string"==typeof e?{value:e,label:e}:e).filter(e=>e?.value).map(e=>({value:e.value,label:e.label??e.value,color:e.value}));return i.length?b({...e,filter:{...e.filter||{},options:i,optionRenderer:e.filter?.optionRenderer??"swatch",defaultOperator:e.filter?.defaultOperator??"in"}},t):f(e,t)}const $={text:f,string:f,number:m,integer:m,date:v,datetime:v,range:g,"date-range":v,"multi-select":b,"single-select":b,choice:b,choices:b,boolean:b,user:b,"entity-multi-select":y,"entity-single-select":y,record:y,relation:y,lookup:y,file:w,color:x};function S(e={},t){const i=e.filter?.control||e.propertyType||e.type||e.dataType||"text";return($[i]||$.text)(e,t)}const T="1/2",k="tonal",_=[[/^image\//u,"image"],[/^video\//u,"movie"],[/^audio\//u,"audiotrack"],[/^text\/(csv|tab-separated-values)$/u,"table"],[/^text\//u,"description"],[/pdf$/u,"picture_as_pdf"],[/(zip|compressed|tar|rar|7z)/u,"folder_zip"],[/(sheet|excel|spreadsheet)/u,"table"],[/(word|document)$/u,"description"],[/(presentation|powerpoint)/u,"slideshow"]];function A(e){const t=String(e||"").toLowerCase(),i=_.find(([e])=>e.test(t));return i?i[1]:"attach_file"}function F(e,t){const i=Je(t);return i?n.html`
148
- <sf-input-color size="1/2" appearance="plain" value=${String(i)}
147
+ `}function b(e,t){return y(e,t)}function w(e,t){const n=e.filter?.options??["image","document","archive","other"].map(e=>({value:e,label:Pe(t,`fileKind_${e}`)}));return y({...e,filter:{...e.filter||{},options:n,defaultOperator:e.filter?.defaultOperator??"in"}},t)}function x(e,t){const n=e.filter?.options??(Array.isArray(e.swatches)?e.swatches:[]).map(e=>"string"==typeof e?{value:e,label:e}:e).filter(e=>e?.value).map(e=>({value:e.value,label:e.label??e.value,color:e.value}));return n.length?y({...e,filter:{...e.filter||{},options:n,optionRenderer:e.filter?.optionRenderer??"swatch",defaultOperator:e.filter?.defaultOperator??"in"}},t):f(e,t)}const $={text:f,string:f,number:m,integer:m,date:v,datetime:v,range:g,"date-range":v,"multi-select":y,"single-select":y,choice:y,choices:y,boolean:y,user:y,"entity-multi-select":b,"entity-single-select":b,record:b,relation:b,lookup:b,file:w,color:x};function k(e={},t){const n=e.filter?.control||e.propertyType||e.type||e.dataType||"text";return($[n]||$.text)(e,t)}const S="1/2",T="tonal",_=[[/^image\//u,"image"],[/^video\//u,"movie"],[/^audio\//u,"audiotrack"],[/^text\/(csv|tab-separated-values)$/u,"table"],[/^text\//u,"description"],[/pdf$/u,"picture_as_pdf"],[/(zip|compressed|tar|rar|7z)/u,"folder_zip"],[/(sheet|excel|spreadsheet)/u,"table"],[/(word|document)$/u,"description"],[/(presentation|powerpoint)/u,"slideshow"]];function A(e){const t=String(e||"").toLowerCase(),n=_.find(([e])=>e.test(t));return n?n[1]:"attach_file"}function F(e,t){const n=Je(t);return n?r.html`
148
+ <sf-input-color size="1/2" appearance="plain" value=${String(n)}
149
149
  label=${e.label||e.key||""} disabled></sf-input-color>
150
- `:n.nothing}function C(e,t){const i=Je(t),r=e.inheritedValue??"";return i||r?n.html`
150
+ `:r.nothing}function C(e,t){const n=Je(t),i=e.inheritedValue??"";return n||i?r.html`
151
151
  <sf-input-color
152
152
  size="1"
153
153
  appearance="plain"
154
- value=${i?String(i):n.nothing}
155
- inherited-value=${r?String(r):n.nothing}
154
+ value=${n?String(n):r.nothing}
155
+ inherited-value=${i?String(i):r.nothing}
156
156
  label=${e.label||e.key||""}
157
157
  disabled
158
158
  ></sf-input-color>
159
- `:n.nothing}function z(e,t,i){const r=Je(t),s=e.inheritedValue??"";return n.html`
159
+ `:r.nothing}function z(e,t,n){const i=Je(t),s=e.inheritedValue??"";return r.html`
160
160
  <sf-input-color
161
- size=${W}
161
+ size=${H}
162
162
  appearance="bordered"
163
163
  name=${J(e)}
164
- value=${r?String(r):n.nothing}
165
- inherited-value=${s?String(s):n.nothing}
166
- swatches=${e.swatches?String(e.swatches):n.nothing}
164
+ value=${i?String(i):r.nothing}
165
+ inherited-value=${s?String(s):r.nothing}
166
+ swatches=${e.swatches?String(e.swatches):r.nothing}
167
167
  ?clearable=${Boolean(s)||!0!==e.required}
168
168
  ?disabled=${!0===e.readonly}
169
169
  label=${e.label||e.key||""}
170
- @change=${t=>i.setFieldValue(e,t.detail?.value??"")}
170
+ @change=${t=>n.setFieldValue(e,t.detail?.value??"")}
171
171
  ></sf-input-color>
172
- `}function E(e,t){return t&&"object"==typeof t&&t.label?se(e)?q(t):{component:{type:"reference-link",props:{line:T,label:String(t.label),icon:A(t.mime),...t.href?{href:String(t.href)}:{}}}}:null}function q(e){const t=String(e.mime??e.mimeType??""),i=Boolean(e.href)&&/^image\//u.test(t);return{component:{type:"file-preview",props:{compact:!0,fileName:String(e.label),mimeType:t,icon:A(t),...e.href?{href:String(e.href)}:{},...i?{imageUrl:String(e.href),kind:"image"}:{kind:"icon"},actions:!1,downloadAction:!1,removeAction:!1}}}}function V(e,t){if(!Array.isArray(t)||!t.length)return null;if("badges"===String(e.variant??""))return L(e,t);const i=e.options||e.filter?.options||e.constraints?.options,r=e=>{const t=Array.isArray(i)?i.find(t=>String(t?.value)===String(e)):null;return String(t?.label??t?.text??e)};return t.map(e=>({component:{type:"tag",props:{line:T,kind:"default",text:r(e)}}}))}function L(e,t){const i=e.options||e.filter?.options||e.constraints?.options;return t.map(t=>{const r=t&&"object"==typeof t?t.value:t,n=Array.isArray(i)?i.find(e=>String(e?.value)===String(r)):null,s=n?(0,o.f)(n):null,a=t&&"object"==typeof t&&void 0!==t.text?String(t.text):String(n?.label??n?.text??r);return{component:{type:"badge",props:{line:T,text:a,appearance:e.badgeAppearance??k,...s?.scheme?{scheme:s.scheme}:{},...s?.rootStyle?{rootStyle:s.rootStyle}:{}}}}})}const P={string:ie,date:R,datetime:R,time:R,boolean:D,choices:V,file:E,color:F,include:le,choice:I,integer:M,number:M,user:U,record:j,relation:j,lookup:B,html:G};function O(e,t){return{yes:e.trueText??e.labels?.true??Pe(t,"yes"),no:e.falseText??e.labels?.false??Pe(t,"no")}}function D(e,t,i){if("boolean"!=typeof t)return null;const r=O(e,i);return t?r.yes:r.no}function I(e,t){const i=e.options||e.filter?.options||e.constraints?.options;if(!Array.isArray(i))return null;const r=i.find(e=>String(e?.value)===String(t));if(!r)return null;const n=(0,o.f)(r);return{component:{type:"badge",props:{line:T,text:r.label??r.text??String(t),appearance:e.badgeAppearance??k,...n?.scheme?{scheme:n.scheme}:{},...n?.rootStyle?{rootStyle:n.rootStyle}:{}}}}}function R(e,t,i){const r=i?.formatFieldValue?.(e,t);return"string"==typeof r&&""!==r?r:null}function M(e,t,i){const r=e.variant||e.filter?.variant,n=Number(Je(t));return"scale"===r&&Number.isFinite(n)?n<0||n>100?null:{component:{type:"progress-scale",props:{line:T,value:String(n)}}}:R(e,t,i)}function N(e){return{component:{type:"reference-link",props:{line:T,appearance:"plain",icon:"",label:String(e.label),...e.href?{href:String(e.href)}:{}}}}}function U(e,t){return t&&"object"==typeof t&&t.label?[{component:{type:"avatar",props:{line:T,text:t.avatarText||""}}},t.href?N(t):String(t.label)]:null}function j(e,t){return t&&"object"==typeof t&&t.label?N(t):null}function B(e,t){const i=De(e,t);return i.length?i.map(e=>e.label).join(", "):null}function G(e,t){return(0,d.j)(t)||null}function H(e={},t,i){const r=e.propertyType||e.type||e.dataType,n=P[r];if(!n)return null;const s=n(e,t,i);return s??null}let W="1";const K={record:Oe,relation:Oe,user:Oe,lookup:Ie,string:ce,text:de,html:pe,integer:me,number:me,date:ye,datetime:xe,time:$e,boolean:Se,choice:Ce,choices:qe,file:Ue,color:z,include:ae};function J(e){return`sf_field_${e.key||"value"}`}function Y(e,t,i){return n.html`
172
+ `}function E(e,t){return t&&"object"==typeof t&&t.label?se(e)?q(t):{component:{type:"reference-link",props:{line:S,label:String(t.label),icon:A(t.mime),...t.href?{href:String(t.href)}:{}}}}:null}function q(e){const t=String(e.mime??e.mimeType??""),n=Boolean(e.href)&&/^image\//u.test(t);return{component:{type:"file-preview",props:{compact:!0,fileName:String(e.label),mimeType:t,icon:A(t),...e.href?{href:String(e.href)}:{},...n?{imageUrl:String(e.href),kind:"image"}:{kind:"icon"},actions:!1,downloadAction:!1,removeAction:!1}}}}function L(e,t){if(!Array.isArray(t)||!t.length)return null;if("badges"===String(e.variant??""))return O(e,t);const n=e.options||e.filter?.options||e.constraints?.options,i=e=>{const t=Array.isArray(n)?n.find(t=>String(t?.value)===String(e)):null;return String(t?.label??t?.text??e)};return t.map(e=>({component:{type:"tag",props:{line:S,kind:"default",text:i(e)}}}))}function O(e,t){const n=e.options||e.filter?.options||e.constraints?.options;return t.map(t=>{const i=t&&"object"==typeof t?t.value:t,r=Array.isArray(n)?n.find(e=>String(e?.value)===String(i)):null,s=r?(0,o.f)(r):null,a=t&&"object"==typeof t&&void 0!==t.text?String(t.text):String(r?.label??r?.text??i);return{component:{type:"badge",props:{line:S,text:a,appearance:e.badgeAppearance??T,...s?.scheme?{scheme:s.scheme}:{},...s?.rootStyle?{rootStyle:s.rootStyle}:{}}}}})}const P={string:ne,date:D,datetime:D,time:D,boolean:I,choices:L,file:E,color:F,include:le,choice:R,integer:M,number:M,user:j,record:U,relation:U,lookup:B,html:G};function V(e,t){return{yes:e.trueText??e.labels?.true??Pe(t,"yes"),no:e.falseText??e.labels?.false??Pe(t,"no")}}function I(e,t,n){if("boolean"!=typeof t)return null;const i=V(e,n);return t?i.yes:i.no}function R(e,t){const n=e.options||e.filter?.options||e.constraints?.options;if(!Array.isArray(n))return null;const i=n.find(e=>String(e?.value)===String(t));if(!i)return null;const r=(0,o.f)(i);return{component:{type:"badge",props:{line:S,text:i.label??i.text??String(t),appearance:e.badgeAppearance??T,...r?.scheme?{scheme:r.scheme}:{},...r?.rootStyle?{rootStyle:r.rootStyle}:{}}}}}function D(e,t,n){const i=n?.formatFieldValue?.(e,t);return"string"==typeof i&&""!==i?i:null}function M(e,t,n){const i=e.variant||e.filter?.variant,r=Number(Je(t));return"scale"===i&&Number.isFinite(r)?r<0||r>100?null:{component:{type:"progress-scale",props:{line:S,value:String(r)}}}:D(e,t,n)}function N(e){return{component:{type:"reference-link",props:{line:S,appearance:"plain",icon:"",label:String(e.label),...e.href?{href:String(e.href)}:{}}}}}function j(e,t){return t&&"object"==typeof t&&t.label?[{component:{type:"avatar",props:{line:S,text:t.avatarText||""}}},t.href?N(t):String(t.label)]:null}function U(e,t){return t&&"object"==typeof t&&t.label?N(t):null}function B(e,t){const n=Ie(e,t);return n.length?n.map(e=>e.label).join(", "):null}function G(e,t){return(0,d.j)(t)||null}function W(e={},t,n){const i=e.propertyType||e.type||e.dataType,r=P[i];if(!r)return null;const s=r(e,t,n);return s??null}let H="1";const K={record:Ve,relation:Ve,user:Ve,lookup:Re,string:ce,text:de,html:pe,integer:me,number:me,date:be,datetime:xe,time:$e,boolean:ke,choice:Ce,choices:qe,file:je,color:z,include:ae};function J(e){return`sf_field_${e.key||"value"}`}function Y(e,t,n){return r.html`
173
173
  <sf-input-country
174
- size=${W}
174
+ size=${H}
175
175
  name=${J(e)}
176
176
  value=${Je(t)??""}
177
177
  aria-label=${e.label||e.key||""}
@@ -179,38 +179,38 @@
179
179
  ?disabled=${!0===e.readonly}
180
180
  use-mask="true"
181
181
  show-code="true"
182
- @change=${t=>i.setFieldValue(e,t.detail?.value??t.target?.value??"")}
182
+ @change=${t=>n.setFieldValue(e,t.detail?.value??t.target?.value??"")}
183
183
  ></sf-input-country>
184
- `}function X(e){return"password"===String(e.variant??"")}function Z(e){return e&&"object"==typeof e&&!Array.isArray(e)?!0===e.set:"string"==typeof e&&""!==e}function Q(e,t){return Pe(e,Z(t)?"passwordSet":"passwordUnset")}function ee(e){const t=e.currentTarget,i=t?.closest?.(".sf-field-password")?.querySelector?.("sf-input");if(!i)return;const r="false"===t.getAttribute("pressed");i.setAttribute("input-type",r?"text":"password"),t.setAttribute("pressed",r?"":"false"),t.setAttribute("icon",r?"visibility_off":"visibility")}function te(e,t,i){const r=Z(t),s=e.placeholder||(r?Pe(i,"passwordKeep"):""),o=t=>{const r=t.target?.value??"";i.setFieldValue(e,""===r?void 0:r)};return n.html`
184
+ `}function X(e){return"password"===String(e.variant??"")}function Z(e){return e&&"object"==typeof e&&!Array.isArray(e)?!0===e.set:"string"==typeof e&&""!==e}function Q(e,t){return Pe(e,Z(t)?"passwordSet":"passwordUnset")}function ee(e){const t=e.currentTarget,n=t?.closest?.(".sf-field-password")?.querySelector?.("sf-input");if(!n)return;const i="false"===t.getAttribute("pressed");n.setAttribute("input-type",i?"text":"password"),t.setAttribute("pressed",i?"":"false"),t.setAttribute("icon",i?"visibility_off":"visibility")}function te(e,t,n){const i=Z(t),s=e.placeholder||(i?Pe(n,"passwordKeep"):""),o=t=>{const i=t.target?.value??"";n.setFieldValue(e,""===i?void 0:i)};return r.html`
185
185
  <span class="sf-field-password flex items-cross-center gap-1/3 min-w-0" spellcheck="false">
186
186
  <sf-input
187
- size=${W}
187
+ size=${H}
188
188
  appearance="bordered"
189
189
  root-class="flex-1 min-w-0"
190
190
  input-type="password"
191
191
  autocomplete="new-password"
192
192
  name=${J(e)}
193
- placeholder=${s||n.nothing}
194
- ?required=${Boolean(e.required)&&!r}
193
+ placeholder=${s||r.nothing}
194
+ ?required=${Boolean(e.required)&&!i}
195
195
  aria-label=${e.label||e.key||""}
196
196
  @input=${o}
197
197
  @change=${o}
198
198
  ></sf-input>
199
199
  <sf-button-icon
200
- size=${W}
200
+ size=${H}
201
201
  appearance="link"
202
202
  scheme="on-surface"
203
203
  icon="visibility"
204
204
  pressed="false"
205
- aria-label=${Pe(i,"showPassword")}
205
+ aria-label=${Pe(n,"showPassword")}
206
206
  @click=${ee}
207
207
  ></sf-button-icon>
208
208
  </span>
209
- `}function ie(e,t,i){return X(e)?Q(i,t):null}function re(e,t,i){return X(e)?n.html`<span class="sf-field-view">${Q(i,t)}</span>`:Xe(e,t,i)}const ne=new Set(["image","image-card","image-list"]);function se(e){return ne.has(String(e.variant??""))}function oe(e,t){const i=Je(t);return i?n.html`
210
- <pre class="sf-field-include" data-language=${e.language?String(e.language):n.nothing}><code>${String(i)}</code></pre>
211
- `:n.nothing}function ae(e,t,i){return n.html`
209
+ `}function ne(e,t,n){return X(e)?Q(n,t):null}function ie(e,t,n){return X(e)?r.html`<span class="sf-field-view">${Q(n,t)}</span>`:Xe(e,t,n)}const re=new Set(["image","image-card","image-list"]);function se(e){return re.has(String(e.variant??""))}function oe(e,t){const n=Je(t);return n?r.html`
210
+ <pre class="sf-field-include" data-language=${e.language?String(e.language):r.nothing}><code>${String(n)}</code></pre>
211
+ `:r.nothing}function ae(e,t,n){return r.html`
212
212
  <sf-input-textarea
213
- size=${W}
213
+ size=${H}
214
214
  appearance="bordered"
215
215
  class="sf-field-include-edit"
216
216
  name=${J(e)}
@@ -220,142 +220,142 @@
220
220
  ?required=${Boolean(e.required)}
221
221
  aria-label=${e.label||e.key||""}
222
222
  ?disabled=${!0===e.readonly}
223
- @change=${t=>i.setFieldValue(e,t.target?.value??"")}
224
- @input=${t=>i.setFieldValue(e,t.target?.value??"")}
223
+ @change=${t=>n.setFieldValue(e,t.target?.value??"")}
224
+ @input=${t=>n.setFieldValue(e,t.target?.value??"")}
225
225
  ></sf-input-textarea>
226
- `}function le(e,t){const i=Je(t);if(!i)return n.nothing;const r=String(i).split("\n")[0];return n.html`<code>${r.length>60?`${r.slice(0,60)}…`:r}</code>`}function ce(e,t,i){const r=(0,u.$)(e);return"phone"===String(e.variant??"")?Y(e,t,i):X(e)?te(e,t,i):r?ue(e,t,i,r):(t=Je(t),n.html`
226
+ `}function le(e,t){const n=Je(t);if(!n)return r.nothing;const i=String(n).split("\n")[0];return r.html`<code>${i.length>60?`${i.slice(0,60)}…`:i}</code>`}function ce(e,t,n){const i=(0,u.$)(e);return"phone"===String(e.variant??"")?Y(e,t,n):X(e)?te(e,t,n):i?ue(e,t,n,i):(t=Je(t),r.html`
227
227
  <sf-input
228
- size=${W}
228
+ size=${H}
229
229
  appearance="bordered"
230
230
  name=${J(e)}
231
231
  value=${t??""}
232
- placeholder=${e.placeholder||n.nothing}
232
+ placeholder=${e.placeholder||r.nothing}
233
233
  ?required=${Boolean(e.required)}
234
234
  aria-label=${e.label||e.key||""}
235
- @input=${t=>i.setFieldValue(e,t.target?.value??"")}
236
- @change=${t=>i.setFieldValue(e,t.target?.value??"")}
235
+ @input=${t=>n.setFieldValue(e,t.target?.value??"")}
236
+ @change=${t=>n.setFieldValue(e,t.target?.value??"")}
237
237
  ></sf-input>
238
- `)}function ue(e,t,i,r){t=Je(t);const s=!1===e.nullable?"":null,o=(t,n)=>{const o=t.currentTarget,a=String(o?.value??""),l=(0,u.C)(a,r);if("incomplete"===l){const t=Pe(i,"maskIncomplete");return n&&o&&(o.setAttribute("error-message",t),o.toggleAttribute("invalid",!0)),void("function"==typeof i.setFieldError?(i.setFieldError(e,t),i.setFieldValue(e,a)):i.setFieldValue(e,void 0))}o?.hasAttribute("invalid")&&(o.toggleAttribute("invalid",!1),o.removeAttribute("error-message")),i.setFieldError?.(e,null),i.setFieldValue(e,"empty"===l?s:a)};return n.html`
238
+ `)}function ue(e,t,n,i){t=Je(t);const s=!1===e.nullable?"":null,o=(t,r)=>{const o=t.currentTarget,a=String(o?.value??""),l=(0,u.C)(a,i);if("incomplete"===l){const t=Pe(n,"maskIncomplete");return r&&o&&(o.setAttribute("error-message",t),o.toggleAttribute("invalid",!0)),void("function"==typeof n.setFieldError?(n.setFieldError(e,t),n.setFieldValue(e,a)):n.setFieldValue(e,void 0))}o?.hasAttribute("invalid")&&(o.toggleAttribute("invalid",!1),o.removeAttribute("error-message")),n.setFieldError?.(e,null),n.setFieldValue(e,"empty"===l?s:a)};return r.html`
239
239
  <sf-input
240
- size=${W}
240
+ size=${H}
241
241
  appearance="bordered"
242
242
  name=${J(e)}
243
243
  value=${t??""}
244
- placeholder=${e.placeholder||n.nothing}
244
+ placeholder=${e.placeholder||r.nothing}
245
245
  autocomplete="off"
246
246
  mask
247
- mask-pattern=${r}
247
+ mask-pattern=${i}
248
248
  ?required=${Boolean(e.required)}
249
249
  aria-label=${e.label||e.key||""}
250
250
  @input=${e=>o(e,!1)}
251
251
  @change=${e=>o(e,!0)}
252
252
  ></sf-input>
253
- `}function de(e,t,i){return t=Je(t),n.html`
253
+ `}function de(e,t,n){return t=Je(t),r.html`
254
254
  <sf-input-textarea
255
- size=${W}
255
+ size=${H}
256
256
  appearance="bordered"
257
257
  name=${J(e)}
258
258
  value=${t??""}
259
- placeholder=${e.placeholder||n.nothing}
259
+ placeholder=${e.placeholder||r.nothing}
260
260
  ?required=${Boolean(e.required)}
261
261
  aria-label=${e.label||e.key||""}
262
- @input=${t=>i.setFieldValue(e,t.target?.value??"")}
263
- @change=${t=>i.setFieldValue(e,t.target?.value??"")}
262
+ @input=${t=>n.setFieldValue(e,t.target?.value??"")}
263
+ @change=${t=>n.setFieldValue(e,t.target?.value??"")}
264
264
  ></sf-input-textarea>
265
- `}function pe(e,t,i){t=Je(t);const r=t=>i.setFieldValue(e,t.currentTarget?.value??"");return n.html`
265
+ `}function pe(e,t,n){t=Je(t);const i=t=>n.setFieldValue(e,t.currentTarget?.value??"");return r.html`
266
266
  <sf-input-rich
267
- size=${W}
267
+ size=${H}
268
268
  appearance="bordered"
269
269
  name=${J(e)}
270
270
  value=${"string"==typeof t?t:""}
271
- placeholder=${e.placeholder||n.nothing}
271
+ placeholder=${e.placeholder||r.nothing}
272
272
  ?required=${Boolean(e.required)}
273
273
  ?disabled=${Ge}
274
274
  aria-label=${e.label||e.key||""}
275
- @input=${r}
276
- @change=${r}
275
+ @input=${i}
276
+ @change=${i}
277
277
  ></sf-input-rich>
278
- `}function he(e){return"stepper"===String(e.variant??"")}function fe(e){if(null==e||""===e)return"";const t=Number(e);return Number.isFinite(t)?String(t):""}function ge(e,t,i){const r="number"===(e.propertyType||e.type),s=fe(e.step),o=r?fe(e.precision)||(s?"":"2"):"0",a=t=>i.setFieldValue(e,t.detail?.value??null);return n.html`
278
+ `}function he(e){return"stepper"===String(e.variant??"")}function fe(e){if(null==e||""===e)return"";const t=Number(e);return Number.isFinite(t)?String(t):""}function ge(e,t,n){const i="number"===(e.propertyType||e.type),s=fe(e.step),o=i?fe(e.precision)||(s?"":"2"):"0",a=t=>n.setFieldValue(e,t.detail?.value??null);return r.html`
279
279
  <sf-input-quantity
280
- size=${W}
280
+ size=${H}
281
281
  name=${J(e)}
282
282
  value=${fe(Je(t))}
283
- min=${fe(e.min)||n.nothing}
284
- max=${fe(e.max)||n.nothing}
285
- step=${s||n.nothing}
286
- precision=${o||n.nothing}
283
+ min=${fe(e.min)||r.nothing}
284
+ max=${fe(e.max)||r.nothing}
285
+ step=${s||r.nothing}
286
+ precision=${o||r.nothing}
287
287
  aria-label=${e.label||e.key||""}
288
288
  ?required=${Boolean(e.required)}
289
289
  ?disabled=${!0===e.readonly}
290
290
  @input=${a}
291
291
  @change=${a}
292
292
  ></sf-input-quantity>
293
- `}function me(e,t,i){if(he(e))return ge(e,t,i);const r="number"===(e.propertyType||e.type);return t=Je(t),n.html`
293
+ `}function me(e,t,n){if(he(e))return ge(e,t,n);const i="number"===(e.propertyType||e.type);return t=Je(t),r.html`
294
294
  <sf-input
295
- size=${W}
295
+ size=${H}
296
296
  appearance="bordered"
297
297
  name=${J(e)}
298
298
  value=${t??""}
299
- inputmode=${r?"decimal":"numeric"}
299
+ inputmode=${i?"decimal":"numeric"}
300
300
  ?required=${Boolean(e.required)}
301
301
  aria-label=${e.label||e.key||""}
302
- @input=${t=>{const r=t.target?.value??"";i.setFieldValue(e,""===r?null:Number(r))}}
303
- @change=${t=>{const r=t.target?.value??"";i.setFieldValue(e,""===r?null:Number(r))}}
302
+ @input=${t=>{const i=t.target?.value??"";n.setFieldValue(e,""===i?null:Number(i))}}
303
+ @change=${t=>{const i=t.target?.value??"";n.setFieldValue(e,""===i?null:Number(i))}}
304
304
  ></sf-input>
305
- `}const ve=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?)(Z|[+-]\d{2}:?\d{2})?$/;function be(e){const t="string"==typeof e?e.trim().match(ve):null;return t?{date:t[1],suffix:`T${t[2]}${t[3]||""}`}:{date:e,suffix:""}}function ye(e,t,i){t=Je(t);const{date:r,suffix:s}=be(t);return n.html`
305
+ `}const ve=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?)(Z|[+-]\d{2}:?\d{2})?$/;function ye(e){const t="string"==typeof e?e.trim().match(ve):null;return t?{date:t[1],suffix:`T${t[2]}${t[3]||""}`}:{date:e,suffix:""}}function be(e,t,n){t=Je(t);const{date:i,suffix:s}=ye(t);return r.html`
306
306
  <sf-input-date
307
- size=${W}
307
+ size=${H}
308
308
  name=${J(e)}
309
- value=${r??""}
309
+ value=${i??""}
310
310
  aria-label=${e.label||e.key||""}
311
311
  ?required=${Boolean(e.required)}
312
- @change=${t=>{const r=t.detail?.value??t.target?.value??null;i.setFieldValue(e,r&&s?`${r}${s}`:r)}}
312
+ @change=${t=>{const i=t.detail?.value??t.target?.value??null;n.setFieldValue(e,i&&s?`${i}${s}`:i)}}
313
313
  ></sf-input-date>
314
- `}function we(e){const t=Number(e.step);return Number.isInteger(t)&&t>=1&&t<=60?String(t):""}function xe(e,t,i){const r=(0,c.AC)(t),s=r.date?`${r.date}${r.time?`T${r.time}`:""}`:"",o="string"==typeof e.min?e.min:"",a="string"==typeof e.max?e.max:"",l=we(e);return n.html`
314
+ `}function we(e){const t=Number(e.step);return Number.isInteger(t)&&t>=1&&t<=60?String(t):""}function xe(e,t,n){const i=(0,c.AC)(t),s=i.date?`${i.date}${i.time?`T${i.time}`:""}`:"",o="string"==typeof e.min?e.min:"",a="string"==typeof e.max?e.max:"",l=we(e);return r.html`
315
315
  <sf-input-date
316
316
  class="sf-field-datetime"
317
317
  mode="datetime"
318
- size=${W}
318
+ size=${H}
319
319
  name=${J(e)}
320
320
  .value=${s}
321
- min-date=${o||n.nothing}
322
- max-date=${a||n.nothing}
323
- minute-step=${l||n.nothing}
321
+ min-date=${o||r.nothing}
322
+ max-date=${a||r.nothing}
323
+ minute-step=${l||r.nothing}
324
324
  aria-label=${e.label||e.key||""}
325
325
  ?required=${Boolean(e.required)}
326
- @change=${t=>{if(t.target!==t.currentTarget)return;const[n="",s=""]=String(t.detail?.value??"").split("T"),o=(0,c.cy)(r,{date:n,time:s});if(o.error)return;const a=null===o.value?r.known&&!r.date:o.value===r.raw;i.setFieldValue(e,a?void 0:o.value)}}
326
+ @change=${t=>{if(t.target!==t.currentTarget)return;const[r="",s=""]=String(t.detail?.value??"").split("T"),o=(0,c.cy)(i,{date:r,time:s});if(o.error)return;const a=null===o.value?i.known&&!i.date:o.value===i.raw;n.setFieldValue(e,a?void 0:o.value)}}
327
327
  ></sf-input-date>
328
- `}function $e(e,t,i){const r=(0,c.SB)(t),s="string"==typeof e.min?e.min:"",o="string"==typeof e.max?e.max:"",a=we(e);return n.html`
328
+ `}function $e(e,t,n){const i=(0,c.SB)(t),s="string"==typeof e.min?e.min:"",o="string"==typeof e.max?e.max:"",a=we(e);return r.html`
329
329
  <sf-input-date
330
330
  class="sf-field-time"
331
331
  mode="time"
332
- size=${W}
332
+ size=${H}
333
333
  name=${J(e)}
334
- .value=${r.time}
335
- min-time=${s||n.nothing}
336
- max-time=${o||n.nothing}
337
- minute-step=${a||n.nothing}
334
+ .value=${i.time}
335
+ min-time=${s||r.nothing}
336
+ max-time=${o||r.nothing}
337
+ minute-step=${a||r.nothing}
338
338
  aria-label=${e.label||e.key||""}
339
339
  ?required=${Boolean(e.required)}
340
- @change=${t=>{if(t.target!==t.currentTarget)return;const n=(0,c.MC)(r,String(t.detail?.value??""));if(n.error)return;const s=null===n.value?r.known&&!r.time:n.value===r.raw;i.setFieldValue(e,s?void 0:n.value)}}
340
+ @change=${t=>{if(t.target!==t.currentTarget)return;const r=(0,c.MC)(i,String(t.detail?.value??""));if(r.error)return;const s=null===r.value?i.known&&!i.time:r.value===i.raw;n.setFieldValue(e,s?void 0:r.value)}}
341
341
  ></sf-input-date>
342
- `}function Se(e,t,i){if(!(!0!==e.required))return n.html`
342
+ `}function ke(e,t,n){if(!(!0!==e.required))return r.html`
343
343
  <sf-switch
344
- size=${W}
344
+ size=${H}
345
345
  name=${J(e)}
346
346
  ?checked=${!0===t}
347
347
  aria-label=${e.label||e.key||""}
348
- @change=${t=>i.setFieldValue(e,Boolean(t.target?.checked))}
348
+ @change=${t=>n.setFieldValue(e,Boolean(t.target?.checked))}
349
349
  ></sf-switch>
350
- `;const r=O(e,i),s=JSON.stringify([{value:"yes",label:r.yes},{value:"no",label:r.no}]);return n.html`
350
+ `;const i=V(e,n),s=JSON.stringify([{value:"yes",label:i.yes},{value:"no",label:i.no}]);return r.html`
351
351
  <sf-button-group
352
- size=${W}
352
+ size=${H}
353
353
  items=${s}
354
- value=${!0===t?"yes":!1===t?"no":n.nothing}
354
+ value=${!0===t?"yes":!1===t?"no":r.nothing}
355
355
  aria-label=${e.label||e.key||""}
356
- @change=${t=>{const r=t.detail?.value;i.setFieldValue(e,"yes"===r||"no"!==r&&null)}}
356
+ @change=${t=>{const i=t.detail?.value;n.setFieldValue(e,"yes"===i||"no"!==i&&null)}}
357
357
  ></sf-button-group>
358
- `}function Te(e,t,i){const r=e.options||e.filter?.options||e.constraints?.options||[],n=i?new Set((Array.isArray(t)?t:[]).map(e=>String(e))):new Set([String(t??"")]);return r.map(e=>({type:"text",size:"1",text:e.label??e.text??String(e.value),value:String(e.value),selected:n.has(String(e.value))}))}const ke=new Set(["1/2","1","2"]),_e=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"," ","Enter"]);function Ae(e){return"buttons"===String(e.variant??"")}function Fe(e,t,i){t=Je(t);const r=(e.options||e.filter?.options||e.constraints?.options||[]).filter(e=>e&&null!==e.value&&void 0!==e.value&&""!==String(e.value)),s=r.map(e=>({value:String(e.value),label:String(e.label??e.text??e.value),...e.icon?{icon:String(e.icon)}:{},...e.disabled?{disabled:!0}:{}})),o=String(e.size??""),a=ke.has(o)?o:W,l=Ge,c=!l&&!0===e.readonly,u=!0!==e.required&&!c&&!l,d=null==t?"":String(t),p={capture:!0,handleEvent(e){const t=e.currentTarget,i=e.target?.closest?.("[data-sf-button-group-value]");if(t&&i&&t.contains(i))return c?(e.preventDefault(),void e.stopPropagation()):void(u&&!i.disabled&&i.getAttribute("data-sf-button-group-value")===t.value&&(e.preventDefault(),e.stopPropagation(),t.clear?.()))}},h={capture:!0,handleEvent(e){c&&_e.has(e.key)&&(e.preventDefault(),e.stopPropagation())}};return n.html`
358
+ `}function Se(e,t,n){const i=e.options||e.filter?.options||e.constraints?.options||[],r=n?new Set((Array.isArray(t)?t:[]).map(e=>String(e))):new Set([String(t??"")]);return i.map(e=>({type:"text",size:"1",text:e.label??e.text??String(e.value),value:String(e.value),selected:r.has(String(e.value))}))}const Te=new Set(["1/2","1","2"]),_e=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"," ","Enter"]);function Ae(e){return"buttons"===String(e.variant??"")}function Fe(e,t,n){t=Je(t);const i=(e.options||e.filter?.options||e.constraints?.options||[]).filter(e=>e&&null!==e.value&&void 0!==e.value&&""!==String(e.value)),s=i.map(e=>({value:String(e.value),label:String(e.label??e.text??e.value),...e.icon?{icon:String(e.icon)}:{},...e.disabled?{disabled:!0}:{}})),o=String(e.size??""),a=Te.has(o)?o:H,l=Ge,c=!l&&!0===e.readonly,u=!0!==e.required&&!c&&!l,d=null==t?"":String(t),p={capture:!0,handleEvent(e){const t=e.currentTarget,n=e.target?.closest?.("[data-sf-button-group-value]");if(t&&n&&t.contains(n))return c?(e.preventDefault(),void e.stopPropagation()):void(u&&!n.disabled&&n.getAttribute("data-sf-button-group-value")===t.value&&(e.preventDefault(),e.stopPropagation(),t.clear?.()))}},h={capture:!0,handleEvent(e){c&&_e.has(e.key)&&(e.preventDefault(),e.stopPropagation())}};return r.html`
359
359
  <sf-button-group
360
360
  class="sf-field-choice-buttons"
361
361
  appearance="segmented"
@@ -363,236 +363,349 @@
363
363
  root-class=${c?"flex-wrap pointer-event-none":"flex-wrap"}
364
364
  name=${J(e)}
365
365
  items=${JSON.stringify(s)}
366
- value=${d||n.nothing}
366
+ value=${d||r.nothing}
367
367
  ?disabled=${l}
368
- data-readonly=${c?"true":n.nothing}
368
+ data-readonly=${c?"true":r.nothing}
369
369
  aria-label=${e.label||e.key||""}
370
370
  @click=${p}
371
371
  @keydown=${h}
372
- @change=${t=>{const n=String(t.detail?.value??"");var s;i.setFieldValue(e,""===n?null:(s=n,r.find(e=>String(e.value)===s)?.value??s))}}
372
+ @change=${t=>{const r=String(t.detail?.value??"");var s;n.setFieldValue(e,""===r?null:(s=r,i.find(e=>String(e.value)===s)?.value??s))}}
373
373
  ></sf-button-group>
374
- `}function Ce(e,t,i){return Ae(e)?Fe(e,t,i):(t=Je(t),n.html`
374
+ `}function Ce(e,t,n){return Ae(e)?Fe(e,t,n):(t=Je(t),r.html`
375
375
  <sf-dropdown
376
- size=${W}
376
+ size=${H}
377
377
  appearance="outlined"
378
378
  mode="select"
379
379
  search="false"
380
380
  name=${J(e)}
381
381
  ?required=${Boolean(e.required)}
382
382
  value=${t??""}
383
+ placeholder=${e.placeholder||r.nothing}
383
384
  aria-label=${e.label||e.key||""}
384
- .options=${Te(e,t,!1)}
385
- @change=${t=>i.setFieldValue(e,t.detail?.value??null)}
385
+ .options=${Se(e,t,!1)}
386
+ @change=${t=>n.setFieldValue(e,t.detail?.value??null)}
386
387
  ></sf-dropdown>
387
- `)}const ze=13;function Ee(e,t,i){const r=e.options||e.filter?.options||e.constraints?.options||[],s=new Set((Array.isArray(t)?t:[]).map(e=>String(e)));return n.html`
388
+ `)}const ze=13;function Ee(e,t,n){const i=e.options||e.filter?.options||e.constraints?.options||[],s=new Set((Array.isArray(t)?t:[]).map(e=>String(e)));return r.html`
388
389
  <div class="sf-field-checklist grid gap-1/3 w-full min-w-0" role="group" aria-label=${e.label||e.key||""}
389
390
  style="grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr))">
390
- ${r.map(t=>n.html`<sf-checkbox size=${W}
391
+ ${i.map(t=>r.html`<sf-checkbox size=${H}
391
392
  name=${J(e)} value=${String(t.value)}
392
393
  label=${t.label??t.text??String(t.value)}
393
394
  .checked=${s.has(String(t.value))}
394
- @change=${n=>((t,n)=>{const o=r.filter(e=>String(e.value)===String(t.value)?n:s.has(String(e.value))).map(e=>e.value);i.setFieldValue(e,o)})(t,Boolean(n.target?.checked??n.detail?.checked))}></sf-checkbox>`)}
395
+ @change=${r=>((t,r)=>{const o=i.filter(e=>String(e.value)===String(t.value)?r:s.has(String(e.value))).map(e=>e.value);n.setFieldValue(e,o)})(t,Boolean(r.target?.checked??r.detail?.checked))}></sf-checkbox>`)}
395
396
  </div>
396
- `}function qe(e,t,i){const r=e.options||e.filter?.options||e.constraints?.options||[],s=String(e.variant??"");return"checklist"===s||"select"!==s&&r.length>=ze?Ee(e,t,i):n.html`
397
+ `}function qe(e,t,n){const i=e.options||e.filter?.options||e.constraints?.options||[],s=String(e.variant??"");return"checklist"===s||"select"!==s&&i.length>=ze?Ee(e,t,n):r.html`
397
398
  <sf-dropdown
398
- size=${W}
399
+ size=${H}
399
400
  appearance="outlined"
400
401
  mode="select"
401
402
  multiple
402
403
  search="false"
403
404
  name=${J(e)}
404
405
  ?required=${Boolean(e.required)}
406
+ placeholder=${e.placeholder||r.nothing}
405
407
  aria-label=${e.label||e.key||""}
406
- .options=${Te(e,t,!0)}
407
- @change=${t=>{const r=t.detail?.values??t.detail?.value;i.setFieldValue(e,Array.isArray(r)?r:r?[r]:[])}}
408
+ .options=${Se(e,t,!0)}
409
+ @change=${t=>{const i=t.detail?.values??t.detail?.value;n.setFieldValue(e,Array.isArray(i)?i:i?[i]:[])}}
408
410
  ></sf-dropdown>
409
- `}const Ve={en:{yes:"Yes",no:"No",searchInList:"Find in the list",containsText:"Contains…",fileKind_image:"Images",fileKind_document:"Documents",fileKind_archive:"Archives",fileKind_other:"Other files",operator:"Operator",rangeFrom:"From",rangeTo:"To",loadingOptions:"Loading the options",optionsError:"The options could not be loaded",pickRecord:"Choose a record",pickFromList:"Choose from the list",searchRecords:"Find a record",loadingRecords:"Loading records",recordsError:"The records could not be loaded",retry:"Try again",loadMore:"Load more",removeFile:"Remove",passwordSet:"Set",passwordUnset:"Not set",passwordKeep:"Set; type a new one to replace it",showPassword:"Show password",maskIncomplete:"Complete the field"},ru:{yes:"Да",no:"Нет",searchInList:"Найти в списке",containsText:"Содержит…",fileKind_image:"Изображения",fileKind_document:"Документы",fileKind_archive:"Архивы",fileKind_other:"Прочие файлы",operator:"Оператор",rangeFrom:"От",rangeTo:"До",loadingOptions:"Загрузка вариантов",optionsError:"Не удалось загрузить варианты",pickRecord:"Выберите запись",pickFromList:"Выберите из списка",searchRecords:"Найти запись",loadingRecords:"Загрузка записей",recordsError:"Не удалось загрузить записи",retry:"Повторить",loadMore:"Загрузить ещё",removeFile:"Удалить",passwordSet:"Задан",passwordUnset:"Не задан",passwordKeep:"Задан; введите новый, чтобы заменить",showPassword:"Показать пароль",maskIncomplete:"Заполните поле полностью"}},Le="sf-field-renderers";function Pe(e,t){return e?.getFieldText?.(t)??(0,a.pageText)(Ve,t,e??null,Le)}function Oe(e,t,i){if(!i.loadFieldOptions||!i.getFieldOptionsPage)return null;const r=i.getFieldOptionsPage(e)||null;if("unsupported"===r?.status)return null;const s=i.getFieldOptionSearch?.(e)??"",o=t&&"object"==typeof t?t:null,a=Array.isArray(r?.items)?r.items:[],l=[...o&&!a.some(e=>String(e.value)===String(o.value))?[o]:[],...a].map(e=>({type:"text",size:"1",text:String(e.label??e.value),value:String(e.value),selected:Boolean(o&&String(o.value)===String(e.value))}));return n.html`
410
- <div class="sf-field-picker flex flex-col gap-1/3" data-field-picker=${e.key||n.nothing}>
411
+ `}const Le={en:{yes:"Yes",no:"No",searchInList:"Find in the list",containsText:"Contains…",fileKind_image:"Images",fileKind_document:"Documents",fileKind_archive:"Archives",fileKind_other:"Other files",operator:"Operator",rangeFrom:"From",rangeTo:"To",loadingOptions:"Loading the options",optionsError:"The options could not be loaded",pickRecord:"Choose a record",pickFromList:"Choose from the list",searchRecords:"Find a record",loadingRecords:"Loading records",recordsError:"The records could not be loaded",retry:"Try again",loadMore:"Load more",removeFile:"Remove",passwordSet:"Set",passwordUnset:"Not set",passwordKeep:"Set; type a new one to replace it",showPassword:"Show password",maskIncomplete:"Complete the field"},ru:{yes:"Да",no:"Нет",searchInList:"Найти в списке",containsText:"Содержит…",fileKind_image:"Изображения",fileKind_document:"Документы",fileKind_archive:"Архивы",fileKind_other:"Прочие файлы",operator:"Оператор",rangeFrom:"От",rangeTo:"До",loadingOptions:"Загрузка вариантов",optionsError:"Не удалось загрузить варианты",pickRecord:"Выберите запись",pickFromList:"Выберите из списка",searchRecords:"Найти запись",loadingRecords:"Загрузка записей",recordsError:"Не удалось загрузить записи",retry:"Повторить",loadMore:"Загрузить ещё",removeFile:"Удалить",passwordSet:"Задан",passwordUnset:"Не задан",passwordKeep:"Задан; введите новый, чтобы заменить",showPassword:"Показать пароль",maskIncomplete:"Заполните поле полностью"}},Oe="sf-field-renderers";function Pe(e,t){return e?.getFieldText?.(t)??(0,a.pageText)(Le,t,e??null,Oe)}function Ve(e,t,n){if(!n.loadFieldOptions||!n.getFieldOptionsPage)return null;const i=n.getFieldOptionsPage(e)||null;if("unsupported"===i?.status)return null;const s=n.getFieldOptionSearch?.(e)??"",o=t&&"object"==typeof t?t:null,a=Array.isArray(i?.items)?i.items:[],l=[...o&&!a.some(e=>String(e.value)===String(o.value))?[o]:[],...a].map(e=>({type:"text",size:"1",text:String(e.label??e.value),value:String(e.value),selected:Boolean(o&&String(o.value)===String(e.value))}));return r.html`
412
+ <div class="sf-field-picker flex flex-col gap-1/3" data-field-picker=${e.key||r.nothing}>
411
413
  <sf-dropdown
412
- size=${W}
414
+ size=${H}
413
415
  appearance="outlined"
414
416
  mode="select"
415
417
  search="true"
416
418
  name=${J(e)}
417
419
  ?required=${Boolean(e.required)}
418
420
  value=${o?String(o.value):""}
419
- placeholder=${e.placeholder||Pe(i,"pickRecord")}
420
- search-placeholder=${e.searchPlaceholder||Pe(i,"searchRecords")}
421
+ placeholder=${e.placeholder||Pe(n,"pickRecord")}
422
+ search-placeholder=${e.searchPlaceholder||Pe(n,"searchRecords")}
421
423
  aria-label=${e.label||e.key||""}
422
424
  .options=${l}
423
- @change=${t=>(t=>{if(!t)return void i.setFieldValue(e,null);const r=[o,...a].find(e=>e&&String(e.value)===String(t));i.setFieldValue(e,r?{value:r.value,label:r.label}:{value:t})})(t.detail?.value??null)}
424
- @input=${t=>{const r=t.target?.value??"";i.setFieldOptionSearch?.(e,r),i.loadFieldOptions(e,{cursor:null,search:r})}}
425
+ @change=${t=>(t=>{if(!t)return void n.setFieldValue(e,null);const i=[o,...a].find(e=>e&&String(e.value)===String(t));n.setFieldValue(e,i?{value:i.value,label:i.label}:{value:t})})(t.detail?.value??null)}
426
+ @input=${t=>{const i=t.target?.value??"";n.setFieldOptionSearch?.(e,i),n.loadFieldOptions(e,{cursor:null,search:i})}}
425
427
  ></sf-dropdown>
426
- ${r?n.html`
428
+ ${i?r.html`
427
429
  <div class="sf-field-picker-state flex items-cross-center gap-1/3">
428
430
  <div role="status" aria-live="polite" class="sf-text-1">
429
- ${"loading"!==r.status||r.quiet?"error"===r.status?Pe(i,"recordsError"):"":Pe(i,"loadingRecords")}
431
+ ${"loading"!==i.status||i.quiet?"error"===i.status?Pe(n,"recordsError"):"":Pe(n,"loadingRecords")}
430
432
  </div>
431
- ${"error"===r.status?n.html`
432
- <sf-button appearance="outline" size="1" text=${Pe(i,"retry")}
433
- @click=${()=>i.loadFieldOptions(e,{cursor:null,search:s})}
433
+ ${"error"===i.status?r.html`
434
+ <sf-button appearance="outline" size="1" text=${Pe(n,"retry")}
435
+ @click=${()=>n.loadFieldOptions(e,{cursor:null,search:s})}
434
436
  ></sf-button>
435
- `:n.nothing}
436
- ${r.nextCursor&&"error"!==r.status?n.html`
437
- <sf-button appearance="outline" size="1" text=${Pe(i,"loadMore")}
438
- ?disabled=${"loading"===r.status}
439
- @click=${()=>i.loadFieldOptions(e,{cursor:r.nextCursor,search:s})}
437
+ `:r.nothing}
438
+ ${i.nextCursor&&"error"!==i.status?r.html`
439
+ <sf-button appearance="outline" size="1" text=${Pe(n,"loadMore")}
440
+ ?disabled=${"loading"===i.status}
441
+ @click=${()=>n.loadFieldOptions(e,{cursor:i.nextCursor,search:s})}
440
442
  ></sf-button>
441
- `:n.nothing}
443
+ `:r.nothing}
442
444
  </div>
443
- `:n.nothing}
445
+ `:r.nothing}
444
446
  </div>
445
- `}function De(e,t){const i=Array.isArray(t)?t:[t],r=Array.isArray(e.options)?e.options:[];return i.filter(e=>null!=e&&""!==e).map(e=>{if("object"==typeof e)return{value:e.value,label:String(e.label??e.value??"")};const t=r.find(t=>String(t?.value)===String(e));return{value:e,label:String(t?.label??t?.text??e)}})}function Ie(e,t,i){const r=!0===e.multiple,s=Array.isArray(e.options)&&e.options.length>0;if(!(s||i.loadFieldOptions&&i.getFieldOptionsPage))return null;const o=s?null:i.getFieldOptionsPage(e)||null;if("unsupported"===o?.status)return null;const a=s?"":i.getFieldOptionSearch?.(e)??"",l=De(e,t),c=(s?e.options:Array.isArray(o?.items)?o.items:[]).filter(e=>e&&"object"==typeof e).map(e=>({value:e.value,label:String(e.label??e.text??e.value)})),u=e=>l.some(t=>String(t.value)===String(e.value)),d=[...l.filter(e=>!c.some(t=>String(t.value)===String(e.value))),...c].map(e=>({type:"text",size:"1",text:e.label,value:String(e.value),selected:u(e)})),p=[...l,...c],h=e=>{const t=p.find(t=>String(t.value)===String(e));return t?{value:t.value,label:t.label}:{value:e,label:String(e)}};return n.html`
446
- <div class="sf-field-picker flex flex-col gap-1/3" data-field-picker=${e.key||n.nothing}>
447
+ `}function Ie(e,t){const n=Array.isArray(t)?t:[t],i=Array.isArray(e.options)?e.options:[];return n.filter(e=>null!=e&&""!==e).map(e=>{if("object"==typeof e)return{value:e.value,label:String(e.label??e.value??"")};const t=i.find(t=>String(t?.value)===String(e));return{value:e,label:String(t?.label??t?.text??e)}})}function Re(e,t,n){const i=!0===e.multiple,s=Array.isArray(e.options)&&e.options.length>0;if(!(s||n.loadFieldOptions&&n.getFieldOptionsPage))return null;const o=s?null:n.getFieldOptionsPage(e)||null;if("unsupported"===o?.status)return null;const a=s?"":n.getFieldOptionSearch?.(e)??"",l=Ie(e,t),c=(s?e.options:Array.isArray(o?.items)?o.items:[]).filter(e=>e&&"object"==typeof e).map(e=>({value:e.value,label:String(e.label??e.text??e.value)})),u=e=>l.some(t=>String(t.value)===String(e.value)),d=[...l.filter(e=>!c.some(t=>String(t.value)===String(e.value))),...c].map(e=>({type:"text",size:"1",text:e.label,value:String(e.value),selected:u(e)})),p=[...l,...c],h=e=>{const t=p.find(t=>String(t.value)===String(e));return t?{value:t.value,label:t.label}:{value:e,label:String(e)}};return r.html`
448
+ <div class="sf-field-picker flex flex-col gap-1/3" data-field-picker=${e.key||r.nothing}>
447
449
  <sf-dropdown
448
- size=${W}
450
+ size=${H}
449
451
  appearance="outlined"
450
452
  mode="select"
451
- ?multiple=${r}
453
+ ?multiple=${i}
452
454
  search="true"
453
455
  name=${J(e)}
454
456
  ?required=${Boolean(e.required)}
455
- value=${r?n.nothing:l[0]?String(l[0].value):""}
456
- placeholder=${e.placeholder||Pe(i,"pickFromList")}
457
- search-placeholder=${e.searchPlaceholder||Pe(i,"searchInList")}
457
+ value=${i?r.nothing:l[0]?String(l[0].value):""}
458
+ placeholder=${e.placeholder||Pe(n,"pickFromList")}
459
+ search-placeholder=${e.searchPlaceholder||Pe(n,"searchInList")}
458
460
  aria-label=${e.label||e.key||""}
459
461
  .options=${d}
460
- @change=${t=>{if(r){const r=t.detail?.values??t.detail?.value,n=(Array.isArray(r)?r:r?[r]:[]).filter(e=>""!==e);return void i.setFieldValue(e,n.map(h))}const n=t.detail?.value??null;i.setFieldValue(e,null===n||""===n?null:h(n))}}
461
- @input=${s?n.nothing:t=>{const r=t.target?.value??"";i.setFieldOptionSearch?.(e,r),i.loadFieldOptions(e,{cursor:null,search:r})}}
462
+ @change=${t=>{if(i){const i=t.detail?.values??t.detail?.value,r=(Array.isArray(i)?i:i?[i]:[]).filter(e=>""!==e);return void n.setFieldValue(e,r.map(h))}const r=t.detail?.value??null;n.setFieldValue(e,null===r||""===r?null:h(r))}}
463
+ @input=${s?r.nothing:t=>{const i=t.target?.value??"";n.setFieldOptionSearch?.(e,i),n.loadFieldOptions(e,{cursor:null,search:i})}}
462
464
  ></sf-dropdown>
463
- ${o?n.html`
465
+ ${o?r.html`
464
466
  <div class="sf-field-picker-state flex items-cross-center gap-1/3">
465
467
  <div role="status" aria-live="polite" class="sf-text-1">
466
- ${"loading"!==o.status||o.quiet?"error"===o.status?Pe(i,"optionsError"):"":Pe(i,"loadingOptions")}
468
+ ${"loading"!==o.status||o.quiet?"error"===o.status?Pe(n,"optionsError"):"":Pe(n,"loadingOptions")}
467
469
  </div>
468
- ${"error"===o.status?n.html`
469
- <sf-button appearance="outline" size="1" text=${Pe(i,"retry")}
470
- @click=${()=>i.loadFieldOptions(e,{cursor:null,search:a})}
470
+ ${"error"===o.status?r.html`
471
+ <sf-button appearance="outline" size="1" text=${Pe(n,"retry")}
472
+ @click=${()=>n.loadFieldOptions(e,{cursor:null,search:a})}
471
473
  ></sf-button>
472
- `:n.nothing}
473
- ${o.nextCursor&&"error"!==o.status?n.html`
474
- <sf-button appearance="outline" size="1" text=${Pe(i,"loadMore")}
474
+ `:r.nothing}
475
+ ${o.nextCursor&&"error"!==o.status?r.html`
476
+ <sf-button appearance="outline" size="1" text=${Pe(n,"loadMore")}
475
477
  ?disabled=${"loading"===o.status}
476
- @click=${()=>i.loadFieldOptions(e,{cursor:o.nextCursor,search:a})}
478
+ @click=${()=>n.loadFieldOptions(e,{cursor:o.nextCursor,search:a})}
477
479
  ></sf-button>
478
- `:n.nothing}
480
+ `:r.nothing}
479
481
  </div>
480
- `:n.nothing}
482
+ `:r.nothing}
481
483
  </div>
482
- `}function Re(e){return Array.isArray(e)?e.filter(e=>e&&"object"==typeof e):e&&"object"==typeof e?[e]:[]}function Me(e,t){return"image"===String(e.variant??"")&&!0!==e.multiple&&Re(t).length<=1}function Ne(e,t,i){const r=Re(t)[0]??null,s=Array.isArray(t);return n.html`
484
+ `}function De(e){return Array.isArray(e)?e.filter(e=>e&&"object"==typeof e):e&&"object"==typeof e?[e]:[]}function Me(e,t){return"image"===String(e.variant??"")&&!0!==e.multiple&&De(t).length<=1}function Ne(e,t,n){const i=De(t)[0]??null,s=Array.isArray(t);return r.html`
483
485
  <sf-input-image
484
- size=${W}
486
+ size=${H}
485
487
  name=${J(e)}
486
- accept=${e.accept?String(e.accept):n.nothing}
487
- hint=${e.uploadSupportingText||n.nothing}
488
- .value=${r}
488
+ accept=${e.accept?String(e.accept):r.nothing}
489
+ hint=${e.uploadSupportingText||r.nothing}
490
+ .value=${i}
489
491
  aria-label=${e.label||e.key||""}
490
492
  ?required=${Boolean(e.required)}
491
493
  ?disabled=${!0===e.readonly}
492
- @change=${t=>{const r=t.detail?.value??null;i.setFieldValue(e,s?r?[r]:[]:r);const n=t.detail?.file;n&&i.startFieldUpload&&i.startFieldUpload(e,[{name:n.name,state:"process",progress:0,file:n}])}}
494
+ @change=${t=>{const i=t.detail?.value??null;n.setFieldValue(e,s?i?[i]:[]:i);const r=t.detail?.file;r&&n.startFieldUpload&&n.startFieldUpload(e,[{name:r.name,state:"process",progress:0,file:r}])}}
493
495
  ></sf-input-image>
494
- `}function Ue(e,t,i){if(Me(e,t))return Ne(e,t,i);const r=Re(t),s=!0===e.multiple||Array.isArray(t),o=Boolean(i.startFieldUpload&&i.getFieldUploads),a=o?i.getFieldUploads(e):null,l=Array.isArray(a)?a:[];return n.html`
496
+ `}function je(e,t,n){if(Me(e,t))return Ne(e,t,n);const i=De(t),s=!0===e.multiple||Array.isArray(t),o=Boolean(n.startFieldUpload&&n.getFieldUploads),a=o?n.getFieldUploads(e):null,l=Array.isArray(a)?a:[];return r.html`
495
497
  <div class="sf-field-file flex flex-col">
496
- ${r.map((t,o)=>n.html`
498
+ ${i.map((t,o)=>r.html`
497
499
  <sf-file-preview
498
500
  file-name=${String(t.label??t.name??"File")}
499
501
  file-size=${String(t.size??"")}
500
502
  icon=${A(t.mime??t.mimeType)}
501
503
  mime-type=${String(t.mime??t.mimeType??"")}
502
- href=${t.href?String(t.href):n.nothing}
504
+ href=${t.href?String(t.href):r.nothing}
503
505
  download-action=${t.href?"true":"false"}
504
506
  remove-action="true"
505
- remove-label=${`${Pe(i,"removeFile")} ${t.label??t.name??""}`.trim()}
506
- @sf-file-preview-detach=${()=>(t=>{const n=r.filter((e,i)=>i!==t);i.setFieldValue(e,s?n:n[0]??null)})(o)}
507
+ remove-label=${`${Pe(n,"removeFile")} ${t.label??t.name??""}`.trim()}
508
+ @sf-file-preview-detach=${()=>(t=>{const r=i.filter((e,n)=>n!==t);n.setFieldValue(e,s?r:r[0]??null)})(o)}
507
509
  ></sf-file-preview>
508
510
  `)}
509
511
 
510
- ${o?n.html`
512
+ ${o?r.html`
511
513
  <sf-file-upload
512
- size=${W}
514
+ size=${H}
513
515
  name=${J(e)}
514
516
  accept=${String(e.accept??"")}
515
517
  formats=${String(e.formats??"")}
516
- link-text=${e.uploadText||n.nothing}
517
- text=${e.uploadHint||n.nothing}
518
- supporting-text=${e.uploadSupportingText||n.nothing}
518
+ link-text=${e.uploadText||r.nothing}
519
+ text=${e.uploadHint||r.nothing}
520
+ supporting-text=${e.uploadSupportingText||r.nothing}
519
521
  ?multiple=${s}
520
522
  ?disabled=${!0===e.readonly}
521
523
  aria-label=${e.label||e.key||""}
522
524
  .items=${l}
523
- @sf-file-upload:select=${t=>{const r=t.detail?.files,n=Array.isArray(r)?r:[];n.length&&i.startFieldUpload(e,n)}}
524
- @sf-file-upload:retry=${t=>{i.retryFieldUpload?.(e,Number(t.detail?.index??-1))}}
525
+ @sf-file-upload:select=${t=>{const i=t.detail?.files,r=Array.isArray(i)?i:[];r.length&&n.startFieldUpload(e,r)}}
526
+ @sf-file-upload:retry=${t=>{n.retryFieldUpload?.(e,Number(t.detail?.index??-1))}}
525
527
  ></sf-file-upload>
526
- `:n.nothing}
528
+ `:r.nothing}
527
529
  </div>
528
- `}const je=e=>"1/2"===e?.size?"1/2":"1",Be=(e,t)=>"choice"===e&&Ae(t);let Ge=!1;function He(e={},t,i,r={}){const n=e.propertyType||e.type||e.dataType,s=!0===r?.disabled;if((!0===e.readonly||s)&&lt[n]&&!Be(n,e))return ct(e,t,i,r);const o=K[n];if(!o||!i?.setFieldValue)return null;const a=W,l=Ge;W=je(r),Ge=s;try{return o(e,t,i)}finally{W=a,Ge=l}}let We="1";function Ke(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)&&"string"==typeof e.text}function Je(e){return Ke(e)?e.value:e}function Ye(e,t,i){const r=i?.formatFieldValue?.(e,t);if("string"==typeof r)return r;if(Ke(t))return t.text;const n=Je(t);return null==n?"":String(n)}function Xe(e,t,i){const r=Ye(e,t,i);return r?n.html`<span class="sf-field-view">${r}</span>`:n.nothing}function Ze(e,t){const i=(0,d.b)(t);return i?n.html`<div class="sf-field-view sf-field-html">${(0,s.unsafeHTML)(i)}</div>`:n.nothing}function Qe(e,t,i){if(null==t||""===t)return n.nothing;const r=e.variant||e.filter?.variant,s=Number(Je(t));if("scale"===r&&Number.isFinite(s)&&s>=0&&s<=100)return n.html`<sf-progress-scale size="1" value=${String(s)}></sf-progress-scale>`;const o=Ye(e,t,i);return n.html`<span class="sf-field-view">${e.unit?`${o} ${e.unit}`:o}</span>`}function et(e,t,i){const r=Ye(e,t,i);return r?n.html`<span class="sf-field-view">${r}</span>`:n.nothing}function tt(e,t,i){if("boolean"!=typeof t)return n.nothing;const r=O(e,i);return n.html`<span class="sf-field-view">${t?r.yes:r.no}</span>`}function it(e,t){const i=e.options||e.filter?.options||e.constraints?.options,r=Array.isArray(i)?i.find(e=>String(e?.value)===String(t)):null;if(!r)return n.nothing;const s=(0,o.f)(r);return n.html`
530
+ `}const Ue=e=>"1/2"===e?.size?"1/2":"1",Be=(e,t)=>"choice"===e&&Ae(t);let Ge=!1;function We(e={},t,n,i={}){const r=e.propertyType||e.type||e.dataType,s=!0===i?.disabled;if((!0===e.readonly||s)&&lt[r]&&!Be(r,e))return ct(e,t,n,i);const o=K[r];if(!o||!n?.setFieldValue)return null;const a=H,l=Ge;H=Ue(i),Ge=s;try{return o(e,t,n)}finally{H=a,Ge=l}}let He="1";function Ke(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)&&"string"==typeof e.text}function Je(e){return Ke(e)?e.value:e}function Ye(e,t,n){const i=n?.formatFieldValue?.(e,t);if("string"==typeof i)return i;if(Ke(t))return t.text;const r=Je(t);return null==r?"":String(r)}function Xe(e,t,n){const i=Ye(e,t,n);return i?r.html`<span class="sf-field-view">${i}</span>`:r.nothing}function Ze(e,t){const n=(0,d.b)(t);return n?r.html`<div class="sf-field-view sf-field-html">${(0,s.unsafeHTML)(n)}</div>`:r.nothing}function Qe(e,t,n){if(null==t||""===t)return r.nothing;const i=e.variant||e.filter?.variant,s=Number(Je(t));if("scale"===i&&Number.isFinite(s)&&s>=0&&s<=100)return r.html`<sf-progress-scale size="1" value=${String(s)}></sf-progress-scale>`;const o=Ye(e,t,n);return r.html`<span class="sf-field-view">${e.unit?`${o} ${e.unit}`:o}</span>`}function et(e,t,n){const i=Ye(e,t,n);return i?r.html`<span class="sf-field-view">${i}</span>`:r.nothing}function tt(e,t,n){if("boolean"!=typeof t)return r.nothing;const i=V(e,n);return r.html`<span class="sf-field-view">${t?i.yes:i.no}</span>`}function nt(e,t){const n=e.options||e.filter?.options||e.constraints?.options,i=Array.isArray(n)?n.find(e=>String(e?.value)===String(t)):null;if(!i)return r.nothing;const s=(0,o.f)(i);return r.html`
529
531
  <sf-badge
530
- line=${We}
531
- appearance=${e.badgeAppearance??k}
532
+ line=${He}
533
+ appearance=${e.badgeAppearance??T}
532
534
  scheme=${s.scheme}
533
- style=${s.rootStyle||n.nothing}
534
- text=${String(r.label??r.text??t)}
535
+ style=${s.rootStyle||r.nothing}
536
+ text=${String(i.label??i.text??t)}
535
537
  ></sf-badge>
536
- `}function rt(e,t){if(!Array.isArray(t)||!t.length)return n.nothing;const i=e.options||e.filter?.options||e.constraints?.options;return n.html`
538
+ `}function it(e,t){if(!Array.isArray(t)||!t.length)return r.nothing;const n=e.options||e.filter?.options||e.constraints?.options;return r.html`
537
539
  <span class="sf-field-view flex flex-wrap items-cross-center gap-1/3 min-w-0">
538
- ${t.map(e=>n.html`<sf-tag root-class="flex-none" line=${We} kind="default" text=${(e=>{const t=Array.isArray(i)?i.find(t=>String(t?.value)===String(e)):null;return String(t?.label??t?.text??e)})(e)}></sf-tag>`)}
540
+ ${t.map(e=>r.html`<sf-tag root-class="flex-none" line=${He} kind="default" text=${(e=>{const t=Array.isArray(n)?n.find(t=>String(t?.value)===String(e)):null;return String(t?.label??t?.text??e)})(e)}></sf-tag>`)}
539
541
  </span>
540
- `}function nt(e,t){return t&&"object"==typeof t&&t.label?n.html`
542
+ `}function rt(e,t){return t&&"object"==typeof t&&t.label?r.html`
541
543
  <span class="sf-field-view flex items-cross-center gap-1/3">
542
- <sf-avatar line=${We} text=${t.avatarText||""}></sf-avatar>
543
- ${t.href?n.html`<sf-reference-link appearance="plain" icon="" line=${We}
544
- label=${String(t.label)} href=${String(t.href)}></sf-reference-link>`:n.html`<span>${String(t.label)}</span>`}
544
+ <sf-avatar line=${He} text=${t.avatarText||""}></sf-avatar>
545
+ ${t.href?r.html`<sf-reference-link appearance="plain" icon="" line=${He}
546
+ label=${String(t.label)} href=${String(t.href)}></sf-reference-link>`:r.html`<span>${String(t.label)}</span>`}
545
547
  </span>
546
- `:n.nothing}function st(e,t){return t&&"object"==typeof t&&t.label?n.html`
548
+ `:r.nothing}function st(e,t){return t&&"object"==typeof t&&t.label?r.html`
547
549
  <sf-reference-link
548
550
  appearance="plain"
549
551
  icon=""
550
- line=${We}
552
+ line=${He}
551
553
  label=${String(t.label)}
552
- href=${t.href?String(t.href):n.nothing}
554
+ href=${t.href?String(t.href):r.nothing}
553
555
  ></sf-reference-link>
554
- `:n.nothing}function ot(e,t){const i=De(e,t);return i.length?1===i.length&&!0!==e.multiple?n.html`<span class="sf-field-view">${i[0].label}</span>`:n.html`
556
+ `:r.nothing}function ot(e,t){const n=Ie(e,t);return n.length?1===n.length&&!0!==e.multiple?r.html`<span class="sf-field-view">${n[0].label}</span>`:r.html`
555
557
  <span class="sf-field-view flex flex-wrap items-cross-center gap-1/3 min-w-0">
556
- ${i.map(e=>n.html`<sf-tag root-class="flex-none" line=${We} kind="default" text=${e.label}></sf-tag>`)}
558
+ ${n.map(e=>r.html`<sf-tag root-class="flex-none" line=${He} kind="default" text=${e.label}></sf-tag>`)}
557
559
  </span>
558
- `:n.nothing}function at(e,t){const i=Re(t);if(!i.length)return n.nothing;const r=se(e),s="image-card"===String(e.variant??"");return n.html`
560
+ `:r.nothing}function at(e,t){const n=De(t);if(!n.length)return r.nothing;const i=se(e),s="image-card"===String(e.variant??"");return r.html`
559
561
  <span class="sf-field-view flex ${s?"flex-row":"flex-col"} gap-1/3">
560
- ${i.map(e=>n.html`
562
+ ${n.map(e=>r.html`
561
563
  <sf-file-preview
562
564
  file-name=${String(e.label??e.name??"File")}
563
565
  file-size=${String(e.size??"")}
564
566
  icon=${A(e.mime??e.mimeType)}
565
567
  mime-type=${String(e.mime??e.mimeType??"")}
566
- href=${e.href?String(e.href):n.nothing}
567
- image-url=${r&&e.href?String(e.href):n.nothing}
568
- kind=${r?"image":n.nothing}
568
+ href=${e.href?String(e.href):r.nothing}
569
+ image-url=${i&&e.href?String(e.href):r.nothing}
570
+ kind=${i?"image":r.nothing}
569
571
  download-action=${e.href?"true":"false"}
570
572
  remove-action="false"
571
573
  ></sf-file-preview>
572
574
  `)}
573
575
  </span>
574
- `}const lt={string:re,text:Xe,html:Ze,integer:Qe,number:Qe,date:et,datetime:et,time:et,boolean:tt,choice:it,choices:rt,user:nt,record:st,relation:st,lookup:ot,file:at,color:C,include:oe};function ct(e={},t,i,r={}){const n=e.propertyType||e.type||e.dataType,s=lt[n];if(!s)return null;const o=We;We=je(r);try{return s(e,t,i)}finally{We=o}}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.fieldRenderers={...window.SF.fieldRenderers||{},renderCellField:H,renderEditField:He,renderFilterField:S,renderViewField:ct,FILTER_RENDERERS:$,dateTime:{split:c.AC,compose:c.cy,normalizeTime:c.d2,splitTime:c.SB,composeTime:c.MC},registry:l.u.map(e=>{return{...e,modes:(t=e.type,(0,l.U)(t,{view:lt,edit:K,cell:P,filter:$}))};var t})},globalThis.document?.dispatchEvent?.(new CustomEvent("sf-field-renderers-ready"))),r()}catch(ut){r(ut)}})},dd6973f77245(e,t,i){i.d(t,{$:()=>a,C:()=>l});const r={0:"\\d",a:"\\p{L}","*":"[\\s\\S]"},n={0:e=>/\d/u.test(e),a:e=>/\p{L}/u.test(e),"*":()=>!0},s=e=>e.replace(/[\\^$.*+?()[\]{}|/]/gu,"\\$&");const o=new Map;function a(e){const t=e?.mask;return"string"==typeof t&&""!==t?t:null}function l(e,t,i="_"){const a=String(e??"");o.has(t)||o.set(t,function(e){let t="";const i=[];for(let o=0;o<e.length;o+=1){const a=e[o];"\\"===a?(o+=1,o<e.length&&(t+=s(e[o]),i.push({fixed:e[o]}))):"{"===a||"}"===a||"["===a||"]"===a||(r[a]?(t+=r[a],i.push({test:n[a]})):(t+=s(a),i.push({fixed:a})))}return{complete:new RegExp(`^${t}$`,"u"),tokens:i}}(t));const{complete:l,tokens:c}=o.get(t);return l.test(a)?"complete":0===function(e,t,i){let r=0,n=0;for(const s of e){for(;n<t.length&&void 0!==t[n].fixed&&t[n].fixed!==s;)n+=1;if(n>=t.length)break;const e=t[n];void 0!==e.fixed||s===i?n+=1:e.test(s)&&(r+=1,n+=1)}return r}(a,c,i)?"empty":"incomplete"}},fc654eb7fab0(e,t,i){i.d(t,{U:()=>n});const r=Object.freeze([{type:"string",label:{ru:"Строка",en:"String"},variants:[{id:"phone",label:{ru:"Телефон",en:"Phone"}},{id:"password",label:{ru:"Пароль",en:"Password"},writeOnly:!0}],params:["placeholder","mask","nullable","required","readonly"]},{type:"text",label:{ru:"Текст",en:"Text"},variants:[],params:["placeholder","required","readonly"]},{type:"html",label:{ru:"Форматированный текст",en:"Formatted text"},variants:[],params:["placeholder","required","readonly"]},{type:"integer",label:{ru:"Целое число",en:"Integer"},variants:[{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","required","readonly"]},{type:"number",label:{ru:"Число",en:"Number"},variants:[{id:"scale",label:{ru:"Шкала 0–100",en:"Scale 0–100"}},{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","precision","required","readonly"]},{type:"date",label:{ru:"Дата",en:"Date"},variants:[],params:["required","readonly"]},{type:"datetime",label:{ru:"Дата и время",en:"Date and time"},variants:[],params:["min","max","step","required","readonly"]},{type:"time",label:{ru:"Время",en:"Time"},variants:[],params:["min","max","step","required","readonly"]},{type:"boolean",label:{ru:"Да или нет",en:"Yes or no"},variants:[],params:["trueText","falseText","required","readonly"]},{type:"choice",label:{ru:"Одно из списка",en:"One of a list"},variants:[{id:"buttons",label:{ru:"Кнопками",en:"As buttons"}}],params:["options","badgeAppearance","size","required","readonly"]},{type:"choices",label:{ru:"Несколько из списка",en:"Several of a list"},variants:[{id:"badges",label:{ru:"Значками",en:"As badges"}},{id:"checklist",label:{ru:"Флажками",en:"As a checklist"}},{id:"select",label:{ru:"Выпадающим списком",en:"As a dropdown"}}],params:["options","badgeAppearance","required","readonly"]},{type:"user",label:{ru:"Пользователь",en:"User"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"record",label:{ru:"Запись",en:"Record"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"relation",label:{ru:"Связь",en:"Relation"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"lookup",label:{ru:"Из справочника",en:"From a reference list"},variants:[],params:["options","multiple","placeholder","searchPlaceholder","required","readonly"]},{type:"file",label:{ru:"Файл",en:"File"},variants:[{id:"image",label:{ru:"Изображение",en:"Image"}},{id:"image-card",label:{ru:"Изображение карточкой",en:"Image card"}},{id:"image-list",label:{ru:"Изображения списком",en:"Image list"}}],params:["accept","multiple","formats","uploadText","uploadSupportingText","uploadHint","required","readonly"]},{type:"color",label:{ru:"Цвет",en:"Colour"},variants:[],params:["swatches","required","readonly"]},{type:"include",label:{ru:"Код",en:"Code"},variants:[],params:["language","required","readonly"]}]);function n(e,t){return{view:Boolean(t.view?.[e]),edit:Boolean(t.edit?.[e]),cell:t.cell?.[e]?"own":"text",filter:t.filter?.[e]?"own":"text"}}i.d(t,["u",0,r])},"5961360f41f4"(e,t,i){i.d(t,{f:()=>c});const r=Object.freeze(["main","tonal","outline"]),n=Object.freeze(["neutral","primary","secondary","tertiary","info","success","warning","error","on-surface"]),s=Object.freeze({danger:"error"}),o=Object.freeze(["1/3","1/2","1"]);function a(e){const t=String(e??"").trim().toLowerCase(),i=s[t]??t;return n.includes(i)?i:""}Object.freeze(n.flatMap(e=>r.filter(t=>!("on-surface"===e&&"tonal"===t)).flatMap(t=>o.map(i=>Object.freeze({type:t,scheme:e,size:i})))));const l=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function c(e={}){const t=e?.scheme??e?.color,i="string"==typeof t?t.trim():"",r=a(i);return r?{scheme:r,rootStyle:""}:l.test(i)?{scheme:"neutral",rootStyle:`--sf-badge--background-color: color-mix(in srgb, ${i} 24%, transparent); --sf-badge--color: var(--sf-on-surface)`}:{scheme:"neutral",rootStyle:""}}},"7623a90f1816"(e,t,i){i.a(e,async(e,t)=>{try{var r=i("deb1a4d61565"),n=i("5b7d7695b41b"),s=i("17828be41e75"),o=i("3ea81f4c3c20"),a=i("4284cc8c32e1"),l=i("99fb492b7fba"),c=i("d614908e644f"),u=i("1b42c5117087"),d=i("43090d1c8307"),p=i("18003344cff0"),h=i("40b137e60526"),f=i("844bdc4d24eb"),g=i("2f31b00ad99a"),m=e([r,n,d,p,h,g]);[r,n,d,p,h,g]=m.then?(await m)():m;var v=i.n(r);const b=["1.0.0","1.1.0","1.2.0","1.3.0","1.4.0","1.5.0","1.6.0","1.7.0","1.8.0","1.9.0","1.10.0","1.11.0","1.12.0","1.13.0","1.14.0","1.15.0","1.16.0","1.17.0"],y=["view","auto","edit","create"],w=20,x=["record","relation","user","lookup"],$=e=>Number.isInteger(e?.field_count)&&e.field_count>0&&(!Array.isArray(e.fields)||0===e.fields.length),S=(e,t)=>{const i=e=>String(e??"").split(".").map(e=>Number.parseInt(e,10)||0),[r,n]=[i(e),i(t)];for(let e=0;e<3;e+=1)if((r[e]??0)!==(n[e]??0))return(r[e]??0)>(n[e]??0);return!0},T="(min-width: 48rem)",k="14rem",_=5e3,A=[];function F(){return A[A.length-1]??null}function C(){A.forEach((e,t)=>{e.setAttribute("data-stack-depth",String(t)),e.toggleAttribute("data-stack-top",e===F()),e.requestComponentUpdate("stack")})}const z=e=>null===e||["string","number","boolean","undefined"].includes(typeof e)||"object"==typeof e&&(Array.isArray(e)||e.constructor===Object),E=e=>null==e?e:"object"==typeof e&&z(e)?Array.isArray(e)?e.map(e=>E(e)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,E(t)])):e,q=(e={})=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase()),t])),V={en:q(l.runtime),ru:q(c.runtime)},L=u.x,P=(0,n.elementFromManifest)(o,{base:v(),lang:{en:l,ru:c},source:"ru",aliases:a});class O extends P{static get props(){return{templateName:{attribute:"template",default:"default"},recordId:{attribute:"record-id",default:""},collection:{default:""},showRare:{attribute:"show-rare",type:Boolean,default:!1},size:{default:"1"},mode:{default:"auto"},emptyText:{attribute:"empty-text",default:"not filled in"},emptyRecordText:{attribute:"empty-record-text",default:"This record has nothing to show"},editText:{attribute:"edit-text",default:"edit"},saveText:{attribute:"save-text",default:"Save"},cancelText:{attribute:"cancel-text",default:"Cancel"},deleteText:{attribute:"delete-text",default:"Delete"},changedText:{attribute:"changed-text",default:"Fields changed"},errorsText:{attribute:"errors-text",default:"Errors"},conflictText:{attribute:"conflict-text",default:"The record changed; read it again"},sectionsLabel:{attribute:"sections-label",default:"Sections"},sectionsAs:{attribute:"sections-as",default:"list",values:["list","tabs"]},panel:{type:Boolean,default:!1},panelSize:{attribute:"panel-size",default:"1",values:["1/2","1","2","full"]},panelLabel:{attribute:"panel-label",default:""},panelWidth:{attribute:"panel-width",default:""},closeLabel:{attribute:"close-label",default:"Close"},copyLinkLabel:{attribute:"copy-link-label",default:"Copy link"},linkCopiedLabel:{attribute:"link-copied-label",default:"Link copied"},openFullLabel:{attribute:"open-full-label",default:"Open as a page"},configureText:{attribute:"configure-text",default:"Arrange the view"},doneConfiguringText:{attribute:"done-configuring-text",default:"Done"},resetViewText:{attribute:"reset-view-text",default:"Reset"},resetViewAskText:{attribute:"reset-view-ask-text",default:"Reset the whole view?"},cancelConfiguringText:{attribute:"cancel-configuring-text",default:"Cancel"},personalLayerText:{attribute:"personal-layer-text",default:"Personal"},viewProfileLabel:{attribute:"view-profile-label",default:"View"},addViewText:{attribute:"add-view-text",default:"Add a view"},newViewText:{attribute:"new-view-text",default:"New view"},deleteViewText:{attribute:"delete-view-text",default:"Remove the view"},lastSharedViewText:{attribute:"last-shared-view-text",default:"The only view everyone has"},sharedLayerText:{attribute:"shared-layer-text",default:"Everyone's"},widthText:{attribute:"width-text",default:"Full width"},fieldLabelText:{attribute:"field-label-text",default:"Name"},sectionIconText:{attribute:"section-icon-text",default:"Section glyph"},sectionIcons:{attribute:"section-icons",default:""},variantText:{attribute:"variant-text",default:"Template"},hintText:{attribute:"hint-text",default:"Hint"},hiddenText:{attribute:"hidden-text",default:"Hide"},configureHintText:{attribute:"configure-hint-text",default:"Drag fields between groups and onto a section on the left. Applied at once."},configureHintNarrowText:{attribute:"configure-hint-narrow-text",default:"Drag fields between groups. Applied at once."},fieldSettingsText:{attribute:"field-settings-text",default:"Field settings"},shownText:{attribute:"shown-text",default:"Shown"},showRareText:{attribute:"show-rare-text",default:"Show rare fields"},hideRareText:{attribute:"hide-rare-text",default:"Hide rare fields"},rareText:{attribute:"rare-text",default:"rare"},unplacedTitle:{attribute:"unplaced-title",default:"Not placed"},moveUpText:{attribute:"move-up-text",default:"Move up"},moveDownText:{attribute:"move-down-text",default:"Move down"},addFieldText:{attribute:"add-field-text",default:"Add a field"},inThisGroupText:{attribute:"in-this-group-text",default:"In this area"},renameText:{attribute:"rename-text",default:"Rename"},saveNameText:{attribute:"save-name-text",default:"Save the name"},cancelNameText:{attribute:"cancel-name-text",default:"Leave the name"},removeFieldText:{attribute:"remove-field-text",default:"Remove from this area"},removeGroupText:{attribute:"remove-group-text",default:"Remove this area"},removeSectionText:{attribute:"remove-section-text",default:"Remove this section"},addGroupText:{attribute:"add-group-text",default:"Add an area"},addSectionText:{attribute:"add-section-text",default:"Add a section"},newGroupTitle:{attribute:"new-group-title",default:"New area"},newSectionTitle:{attribute:"new-section-title",default:"New section"},noMatchText:{attribute:"no-match-text",default:"Nothing matches"},unplacedHintText:{attribute:"unplaced-hint-text",default:"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out."},viewConflictText:{attribute:"view-conflict-text",default:"The view changed and was read again"},viewDeniedText:{attribute:"view-denied-text",default:"You may not change this layer"},backLabel:{attribute:"back-label",default:"Back"},collectionLabel:{attribute:"collection-label",default:""},collectionIcon:{attribute:"collection-icon",default:""},favourite:{type:Boolean,default:!1},favouriteLabel:{attribute:"favourite-label",default:"Favourite"},menuLabel:{attribute:"menu-label",default:"More"},inheritedText:{attribute:"inherited-text",default:"by default"}}}constructor(){super(),this.hostPort=null,this.record=null,this.sections=[],this.selectedSection=null,this.renaming=null,this.namingView=!1,this.arrangementEntered=null,this.resetAsked=!1,this.epoch=0,this.groupReads=new Map,this.groupsReading=new Set,this.groupsRefused=new Map,this.groupEpoch=0,this.message="",this.editing=null,this.changed=new Map,this.errors=new Map,this.inputErrors=new Map,this.controlErrors=new Set,this.conflict=null,this.confirmation=null,this.optionPages=new Map,this.optionSearches=new Map,this.optionEpochs=new Map,this.uploads=new Map,this.view=null,this.configuring=!1,this._openedForDrag=!1,this.viewTarget="personal",this.layerDraft=null,this.entryErrors=new Map,this.viewEpoch=0,this.wide=!0,this.wideMedia=null,this.phoneSection=null}get recordId(){return this.getAttribute("record-id")||""}get collection(){return this.getAttribute("collection")||""}get showRare(){return this.getBooleanAttr("show-rare",!1)}get emptyRecordText(){return this.getAttribute("empty-record-text")||(0,d.pageText)(V,"emptyRecordText",this)}get isEmptyRecord(){if(!this.record)return!1;const e=this.sections??[];return!e.length||!e.some(e=>(e.groups??[]).some(e=>"related"===e.kind||(e.fields??[]).length>0))}get emptyText(){return this.getAttribute("empty-text")||(0,d.pageText)(V,"emptyText",this)}get editText(){return this.getAttribute("edit-text")||(0,d.pageText)(V,"editText",this)}get saveText(){return this.getAttribute("save-text")||(0,d.pageText)(V,"saveText",this)}get cancelText(){return this.getAttribute("cancel-text")||(0,d.pageText)(V,"cancelText",this)}get deleteText(){return this.getAttribute("delete-text")||(0,d.pageText)(V,"deleteText",this)}get unplaced(){const e=this.record?.unplaced;return Array.isArray(e)?e:[]}moveFieldToUnplaced(e,t){if(!this.configuring||!this.layerDraft)return!1;let i=null,r=null;for(const t of this.sections){for(const n of t.groups??[]){const t=(n.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){r=n,[i]=n.fields.splice(t,1);break}}if(i)break}if(!i)return!1;const n=this.record.unplaced??(this.record.unplaced=[]),s=Math.max(0,Math.min(Number.isInteger(t)?t:n.length,n.length));return n.splice(s,0,i),this._writeOrder(this.layerDraft.fields,n,{group:null}),r&&this._writeOrder(this.layerDraft.fields,r.fields??[],{group:String(r.key)}),this.requestComponentUpdate("view-move"),this.saveView()}get recordActions(){const e=this.record?.actions;return Array.isArray(e)?e.map(e=>String(e)):[]}async deleteRecord(){if("view"===this.mode||"create"===this.mode||!this.recordActions.includes("record.delete"))return!1;const e=await this._raise("record.delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null});return this.sfEmit("delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null,answer:e?.answer??null}),!!e&&("applied"===e.answer?(this.closePanel("deleted"),!0):"cancelled"===e.reason?(this._setState("ready"),!1):(this.message=e.message||e.reason||this.viewDeniedText,this._setState("ready"),this.requestComponentUpdate("delete-refused"),!1))}get changedText(){return this.getAttribute("changed-text")||(0,d.pageText)(V,"changedText",this)}get errorsText(){return this.getAttribute("errors-text")||(0,d.pageText)(V,"errorsText",this)}get conflictText(){return this.getAttribute("conflict-text")||(0,d.pageText)(V,"conflictText",this)}get sectionsAs(){return this.getEnumAttr("sections-as",["list","tabs"],"list")}get sectionsLabel(){return this.getAttribute("sections-label")||(0,d.pageText)(V,"sectionsLabel",this)}get panel(){return this.getBooleanAttr("panel",!1)&&!this.full}get full(){return this.getBooleanAttr("full",!1)}set full(e){this.toggleAttribute("full",Boolean(e))}get panelOpen(){return this.panel&&!this.hidden&&"false"!==this.getAttribute("open")}syncPanelOpen(){const e=A.indexOf(this);this.panelOpen&&this.isConnected&&e<0?(A.push(this),C()):!this.panelOpen&&e>=0&&(A.splice(e,1),C()),this.requestComponentUpdate("panel-open")}get revision(){return void 0===this.record?.revision||null===this.record?.revision?"":String(this.record.revision)}get section(){return this.selectedSection??""}get panelSize(){return this.getAttribute("panel-size")||"1"}get panelLabel(){return this.getAttribute("panel-label")||""}get panelWidth(){return this.getAttribute("panel-width")||""}get size(){return"1/2"===this.getAttribute("size")?"1/2":"1"}get mode(){const e=this.getAttribute("mode");return y.includes(e)?e:"auto"}get mayEdit(){return"view"!==this.mode&&("create"===this.mode||(!S(this.hostPort?.version,"1.12.0")||this.recordActions.includes("record.edit")))}get openAll(){return"create"===this.mode||"edit"===this.mode&&this.mayEdit}get drawerWidth(){const e=this.panelWidth;if(!e)return null;if(!this.wide)return e;return`min(${"list"===this.sectionsAs&&((this.sections??[]).length>=2||this.configuring)?`calc(${e} + ${k} + var(--sf-space-4))`:e}, calc(100vw - ${this.edgeRoom}))`}get edgeControlWidth(){const e="1/2"===this.size?"1\\/2":"1";return`calc(var(--sf-text-height-${e}) + 2 * var(--sf-ui-${e}--space-y-tightness-default))`}get edgeRoom(){return`calc(${this.edgeControlWidth} + 2 * var(--sf-space-1\\/2))`}get edgeControlCount(){return 1+(this.address?1:0)+(this.canOpenFullPage?1:0)}get closeLabel(){return this.getAttribute("close-label")||(0,d.pageText)(V,"closeLabel",this)}get linkCopiedLabel(){return this.getAttribute("link-copied-label")||(0,d.pageText)(V,"linkCopiedLabel",this)}get copyLinkLabel(){return this.getAttribute("copy-link-label")||(0,d.pageText)(V,"copyLinkLabel",this)}get configureText(){return this.getAttribute("configure-text")||(0,d.pageText)(V,"configureText",this)}get resetViewAskText(){return this.getAttribute("reset-view-ask-text")||(0,d.pageText)(V,"resetViewAskText",this)}get cancelConfiguringText(){return this.getAttribute("cancel-configuring-text")||(0,d.pageText)(V,"cancelConfiguringText",this)}get doneConfiguringText(){return this.getAttribute("done-configuring-text")||(0,d.pageText)(V,"doneConfiguringText",this)}get resetViewText(){return this.getAttribute("reset-view-text")||(0,d.pageText)(V,"resetViewText",this)}get addViewText(){return this.getAttribute("add-view-text")||(0,d.pageText)(V,"addViewText",this)}get newViewText(){return this.getAttribute("new-view-text")||(0,d.pageText)(V,"newViewText",this)}get deleteViewText(){return this.getAttribute("delete-view-text")||(0,d.pageText)(V,"deleteViewText",this)}get lastSharedViewText(){return this.getAttribute("last-shared-view-text")||(0,d.pageText)(V,"lastSharedViewText",this)}get viewProfileLabel(){return this.getAttribute("view-profile-label")||(0,d.pageText)(V,"viewProfileLabel",this)}get personalLayerText(){return this.getAttribute("personal-layer-text")||(0,d.pageText)(V,"personalLayerText",this)}get sharedLayerText(){return this.getAttribute("shared-layer-text")||(0,d.pageText)(V,"sharedLayerText",this)}get widthText(){return this.getAttribute("width-text")||(0,d.pageText)(V,"widthText",this)}get variantText(){return this.getAttribute("variant-text")||(0,d.pageText)(V,"variantText",this)}get hintText(){return this.getAttribute("hint-text")||(0,d.pageText)(V,"hintText",this)}get hiddenText(){return this.getAttribute("hidden-text")||(0,d.pageText)(V,"hiddenText",this)}get configureHintText(){return this.getAttribute("configure-hint-text")||(0,d.pageText)(V,"configureHintText",this)}get configureHintNarrowText(){return this.getAttribute("configure-hint-narrow-text")||(0,d.pageText)(V,"configureHintNarrowText",this)}get fieldSettingsText(){return this.getAttribute("field-settings-text")||(0,d.pageText)(V,"fieldSettingsText",this)}get shownText(){return this.getAttribute("shown-text")||(0,d.pageText)(V,"shownText",this)}get showRareText(){return this.getAttribute("show-rare-text")||(0,d.pageText)(V,"showRareText",this)}get hideRareText(){return this.getAttribute("hide-rare-text")||(0,d.pageText)(V,"hideRareText",this)}get rareText(){return this.getAttribute("rare-text")||(0,d.pageText)(V,"rareText",this)}get unplacedTitle(){return this.getAttribute("unplaced-title")||(0,d.pageText)(V,"unplacedTitle",this)}get moveUpText(){return this.getAttribute("move-up-text")||(0,d.pageText)(V,"moveUpText",this)}get moveDownText(){return this.getAttribute("move-down-text")||(0,d.pageText)(V,"moveDownText",this)}get addFieldText(){return this.getAttribute("add-field-text")||(0,d.pageText)(V,"addFieldText",this)}get renameText(){return this.getAttribute("rename-text")||(0,d.pageText)(V,"renameText",this)}get saveNameText(){return this.getAttribute("save-name-text")||(0,d.pageText)(V,"saveNameText",this)}get cancelNameText(){return this.getAttribute("cancel-name-text")||(0,d.pageText)(V,"cancelNameText",this)}get removeFieldText(){return this.getAttribute("remove-field-text")||(0,d.pageText)(V,"removeFieldText",this)}get removeGroupText(){return this.getAttribute("remove-group-text")||(0,d.pageText)(V,"removeGroupText",this)}get removeSectionText(){return this.getAttribute("remove-section-text")||(0,d.pageText)(V,"removeSectionText",this)}get addGroupText(){return this.getAttribute("add-group-text")||(0,d.pageText)(V,"addGroupText",this)}get addSectionText(){return this.getAttribute("add-section-text")||(0,d.pageText)(V,"addSectionText",this)}get newGroupTitle(){return this.getAttribute("new-group-title")||(0,d.pageText)(V,"newGroupTitle",this)}get newSectionTitle(){return this.getAttribute("new-section-title")||(0,d.pageText)(V,"newSectionTitle",this)}get sectionIconText(){return this.getAttribute("section-icon-text")||(0,d.pageText)(V,"sectionIconText",this)}get fieldLabelText(){return this.getAttribute("field-label-text")||(0,d.pageText)(V,"fieldLabelText",this)}get inThisGroupText(){return this.getAttribute("in-this-group-text")||(0,d.pageText)(V,"inThisGroupText",this)}get noMatchText(){return this.getAttribute("no-match-text")||(0,d.pageText)(V,"noMatchText",this)}get currentGroups(){const e=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return e?.groups??[]}groupAt(e){return this.currentGroups.findIndex(t=>String(t.key)===String(e))}get groupCount(){return this.currentGroups.length}moveGroupBy(e,t){const i=this.groupAt(e);if(i<0)return!1;const r=i+t;if(r<0||r>=this.groupCount)return!1;const n=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return!!n&&this.moveGroup(e,String(n.key),r)}fieldChoices(e){const t=String(e),i=this._addSession?.group===t?this._addSession:this._buildAddSession(t),r=new Set;for(const e of this._locateGroup(t)?.group?.fields??[])r.add(String(e.key));const n=this.addSearch.trim().toLowerCase(),s=[];for(const e of i.order)(!n||e.label.toLowerCase().includes(n)||e.key.toLowerCase().includes(n))&&s.push({...e,selected:r.has(e.key)});return s}_buildAddSession(e){const t=String(e),i=[],r=new Set,n=(e,t)=>{const n=String(e.key);r.has(n)||(r.add(n),i.push({key:n,label:String(e.label??e.key),group:t}))};for(const e of this._locateGroup(t)?.group?.fields??[])n(e,this.inThisGroupText);for(const e of this.unplaced??[])n(e,this.unplacedTitle);for(const e of this.sections??[])for(const i of e.groups??[]){if(String(i.key)===t||"related"===i.kind)continue;const e=String(i.label??i.key);for(const t of i.fields??[])n(t,e)}return{group:t,order:i}}startAddSession(e){return this._addSearch="",this._addSession=this._buildAddSession(e),this.requestComponentUpdate("add-session"),this._addSession}endAddSession(){this._addSession=null,this._addSearch="",this.requestComponentUpdate("add-session")}get addSearch(){return this._addSearch??""}setAddSearch(e){return this._addSearch=String(e??""),this.requestComponentUpdate("add-search"),this._addSearch}toggleFieldInGroup(e,t,i){return i?this.moveField(e,t,Number.MAX_SAFE_INTEGER):this.moveFieldToUnplaced(e)}get unplacedHintText(){return this.getAttribute("unplaced-hint-text")||(0,d.pageText)(V,"unplacedHintText",this)}get viewConflictText(){return this.getAttribute("view-conflict-text")||(0,d.pageText)(V,"viewConflictText",this)}get collectionLabel(){return this.getAttribute("collection-label")||""}get collectionIcon(){return this.getAttribute("collection-icon")||""}get favourite(){return this.hasAttribute("favourite")}get favouriteLabel(){return this.getAttribute("favourite-label")||(0,d.pageText)(V,"favouriteLabel",this)}get menuLabel(){return this.getAttribute("menu-label")||(0,d.pageText)(V,"menuLabel",this)}get inheritedText(){return this.getAttribute("inherited-text")||(0,d.pageText)(V,"inheritedText",this)}toggleFavourite(){const e=!this.favourite;return this.toggleAttribute("favourite",e),this.requestComponentUpdate("favourite"),this.dispatchEvent(new CustomEvent("sf-view-properties-favourite",{bubbles:!0,composed:!0,detail:{record_id:this.recordId||null,collection:this.collection||null,favourite:e}})),!0}get panelMenuItems(){const e=[];return this.canConfigureView&&!this.configuring&&e.push({id:"configure",name:this.configureText,icon:"tune"}),this.hasRare&&e.push({id:"show-rare",name:this.showRare?this.hideRareText:this.showRareText,icon:this.showRare?"unfold_less":"unfold_more"}),e}async openStandardMenu(e,{label:t,entries:i,select:r,align:n="end"}){if(!(e instanceof Element))return null;await(globalThis.SF?.Loader?.ensure?.(["sf-menu-context"]));let s=this._standardMenu;return s?.isConnected||(s=document.createElement("sf-menu-context"),s.setAttribute("popup",""),s.dataset.sfPropertyViewMenu="",s.addEventListener("sf-menu-context-select",e=>this._standardMenuSelect?.(e.detail?.id)),(this.closest("dialog[open]")||document.body).append(s),this._standardMenu=s),s.isOpen&&this._standardMenuAnchor===e?(s.close(),null):(s.setAttribute("aria-label",t??""),s.entries=i,this._standardMenuSelect=r,this._standardMenuAnchor=e,s.openFor(e,{align:n}))}viewProfileEntries(){const e=this.viewProfile;return this.viewProfiles.map(t=>({id:`view-profile:${t.id}`,text:t.label,kind:"radio",checked:t.id===e,icon:t.shared?"group":"person",caption:t.shared?this.sharedLayerText:this.personalLayerText}))}openPanelMenu(e){const t=[],i=this.viewProfiles;if(i.length>1&&!this.configuring){const e=i.find(e=>e.id===this.viewProfile);t.push({id:"view-profile",text:this.viewProfileLabel,icon:"view_sidebar",value:e?.label??"",submenu:this.viewProfileEntries()})}const r=this.panelMenuItems;t.length&&r.length&&t.push({type:"separator"}),t.push(...r.map(e=>({id:e.id,text:e.name,icon:e.icon})));const n=this.hostMenuEntries();return t.length&&n.length&&t.push({type:"separator"}),t.push(...n),t.length?this.openStandardMenu(e,{label:this.menuLabel,entries:t,select:e=>this._chooseStandardEntry(e)}):null}openViewProfileMenu(e){return this.openStandardMenu(e,{label:this.viewProfileLabel,entries:this.viewProfileEntries(),align:"start",select:e=>this._chooseStandardEntry(e)})}hostMenuElements(){const e=this.querySelector("[data-host-menu]")??this.panelContent?.()?.querySelector?.("[data-host-menu]");return e?[...e.children]:[]}hostMenuEntries(){return this.hostMenuElements().map((e,t)=>{const i=e.matches("a[href], button")?e:e.querySelector("a[href], button")??e,r=(e.getAttribute("text")??e.getAttribute("aria-label")??i.textContent??"").trim(),n=i.matches?.("a[href]")?i.getAttribute("href"):null;return{id:`host:${t}`,text:r,icon:e.getAttribute("icon")??e.getAttribute("icon-start")??e.dataset.icon??void 0,href:n||void 0,danger:"error"===e.getAttribute("scheme")||"true"===e.dataset.danger,disabled:e.hasAttribute("disabled")||!0===i.disabled}}).filter(e=>e.text)}_chooseStandardEntry(e){const t=String(e??"");if(t.startsWith("host:")){const e=this.hostMenuElements()[Number(t.slice(5))],i=e?.matches("a[href], button")?e:e?.querySelector("a[href], button")??e;return i?.matches?.("a[href]")||i?.click?.(),!0}return t.startsWith("view-profile:")?this.selectViewProfile(t.slice(13)):this.chooseMenuItem(t)}chooseMenuItem(e){return"configure"===e?this.startConfiguringView():"reset"===e?this.resetView():"show-rare"===e&&this.toggleShowRare()}get backLabel(){return this.getAttribute("back-label")||(0,d.pageText)(V,"backLabel",this)}get viewDeniedText(){return this.getAttribute("view-denied-text")||(0,d.pageText)(V,"viewDeniedText",this)}get openFullLabel(){return this.getAttribute("open-full-label")||(0,d.pageText)(V,"openFullLabel",this)}get address(){return this.record?.address??null}get canOpenFullPage(){return Boolean(this.address)&&Boolean(this.hostPort?.capabilities?.includes?.("record-open"))}static get observedAttributes(){return[...super.observedAttributes??[],"record-id","hidden","open","full"]}attributeChangedCallback(e,t,i){super.attributeChangedCallback?.(e,t,i),t!==i&&this.isConnected&&("record-id"===e&&this.hostPort&&this.load("record-id-changed"),"hidden"!==e&&"open"!==e&&"full"!==e||this.syncPanelOpen())}onConnected(){super.onConnected?.(),this.hasAttribute("data-state")||this.record||(this.setAttribute("data-state","loading"),this.setAttribute("aria-busy","true")),this.panelOpen&&!A.includes(this)&&(A.push(this),C()),this._onKeyDown=e=>{"Escape"===e.key&&this.panel&&(document.documentElement.dataset.sfPopoverOpen||F()===this&&(e.stopPropagation(),this.closePanel("escape")))},document.addEventListener("keydown",this._onKeyDown,!0),this._onSortableIntent=e=>{if(!this.configuring)return;const t=e.detail??{},[i,r]=String(t.to??"").split(":");r&&("section"===i?this.moveSection(t.item,t.index):"field"===i?this.moveField(t.item,r,t.index):"group"===i?this.moveGroup(t.item,r,t.index):"unplaced"===i&&this.moveFieldToUnplaced(t.item,t.index))},this.addEventListener("sf-sortable-intent",this._onSortableIntent),this._onDocumentSortableIntent=e=>{if(!this.panel||!this.configuring)return;const t=e.target?.closest?.(".sf-property-view-panel");t&&t.getAttribute("data-record-id")===String(this.recordId)&&this._onSortableIntent(e)},document.addEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState=e=>{if(!this.configuring)return;const t=e.detail?.state,i=globalThis.document?.querySelector?.(`.sf-property-view-panel[data-record-id="${this.recordId}"]`),r=i?.querySelector?.('[data-action="toggle-unplaced"]');if(!r)return;const n="true"===r.getAttribute("aria-expanded");if("picked"===t)return this._openedForDrag=!n,void(n||r.click());"dropped"!==t&&"cancelled"!==t||(this._openedForDrag&&"true"===r.getAttribute("aria-expanded")&&r.click(),this._openedForDrag=!1)},document.addEventListener("sf-sortable-state",this._onSortableState),this.wideMedia="function"==typeof globalThis.matchMedia?globalThis.matchMedia(T):null,this.wide=!this.wideMedia||this.wideMedia.matches,this._onWideChange=e=>{this.wide=e.matches,this.wide&&(this.phoneSection=null),this.requestComponentUpdate("viewport")},this.wideMedia?.addEventListener?.("change",this._onWideChange),this.hostPort&&(this.recordId||"create"===this.mode)?this.load("connected"):this.hostPort||this._requestHostPort()}_requestHostPort(){return!this.hostPort&&!this._portRequested&&(this._portRequested=!0,this.dispatchEvent(new CustomEvent("sf-host-port-request",{bubbles:!0,composed:!0,detail:{component:this,context:{owner:"property-view",record:this.recordId||null,group:null}}})),!0)}onDisconnected(){this._standardMenu?.close?.({restoreFocus:!1}),this._standardMenu?.remove(),this._standardMenu=null,this._portRequested=!1;const e=A.indexOf(this);e>=0&&(A.splice(e,1),C()),this._onKeyDown&&document.removeEventListener("keydown",this._onKeyDown,!0),this._onKeyDown=null,this.configuring=!1,this._bindSectionDropTarget(),this._onSortableIntent&&this.removeEventListener("sf-sortable-intent",this._onSortableIntent),this._onSortableIntent=null,this._onDocumentSortableIntent&&document.removeEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState&&document.removeEventListener("sf-sortable-state",this._onSortableState),this._onDocumentSortableIntent=null,this._onWideChange&&this.wideMedia?.removeEventListener?.("change",this._onWideChange),this._onWideChange=null,this.wideMedia=null,super.onDisconnected?.()}panelContent(){const e=this.querySelector("sf-drawer")??this._panelDrawer??null,t=e?.querySelector?.(".sf-property-view-panel");if(t)return t;const i=this.getAttribute("record-id")||"";return[...document.querySelectorAll(".sf-property-view-panel")].find(e=>e.dataset.recordId===i)??null}setHostPort(e){if(!e||"function"!=typeof e.raise||!b.includes(e.version))throw new TypeError(`sf-view-properties requires a declared property-view host port: ${b.join(", ")}`);return this.hostPort=e,this.isConnected&&(this.recordId||"create"===this.mode)&&this.load("host-connected"),this}visible(e,{conditions:t=!0}={}){const i=t?this.fieldValues():null;return(Array.isArray(e)?e:[]).filter(e=>e&&!0!==e.hidden).filter(e=>this.showRare||!0!==e.rare).filter(e=>!i||!e.when||(0,f.tm)(e,i).visible)}fieldValues(){const e=new Map,t=t=>{if(!t||void 0===t.key||null===t.key)return;const i=String(t.key);e.set(i,this.changed.has(i)?this.changed.get(i):t.value)};for(const e of this.sections??[])for(const i of e?.groups??[])(i?.fields??[]).forEach(t);return this.unplaced.forEach(t),e}conditionedField(e,t=this.fieldValues()){if(!e?.when)return e;const i=(0,f.tm)(e,t);return{...e,required:i.required,readonly:!0===e.readonly||!i.enabled}}_hiddenByCondition(){const e=this.fieldValues(),t=new Set,i=i=>{i?.when&&!(0,f.tm)(i,e).visible&&t.add(String(i.key))};for(const e of this.sections??[])for(const t of e?.groups??[])(t?.fields??[]).forEach(i);return this.unplaced.forEach(i),t}_savedValues(){const e=this._hiddenByCondition();return Object.fromEntries([...this.changed].filter(([t])=>!e.has(t)))}get viewHost(){const e=this.hostPort??null;if(this._viewHost?.host===e)return this._viewHost.view;const t=Object.create(e&&"object"==typeof e?e:null);return Object.assign(t,{formatFieldValue:(t,i)=>{const r=e?.formatFieldValue?.(t,i);if("string"==typeof r)return r;const n=t?.propertyType??t?.property_type??t?.type??t?.dataType;return(0,g.x)(n,i,this)||void 0}}),this._viewHost={host:e,view:t},t}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,hostPort:this.hostPort,viewHost:this.viewHost,size:this.size,mode:this.mode,mayEdit:this.mayEdit,openAll:this.openAll,createText:(0,d.pageText)(V,"createText",this),emptyText:this.emptyText,emptyRecordText:this.emptyRecordText,isEmptyRecord:this.isEmptyRecord,loading:"loading"===this.getAttribute("data-state")&&!this.record,panel:this.panel,panelOpen:this.panelOpen,recordLabel:this.record?.label?String(this.record.label):"",loadFailure:this.record?null:this.loadFailure??null,editText:this.editText,saveText:this.saveText,cancelText:this.cancelText,deleteText:this.deleteText,recordActions:this.recordActions,changedText:this.changedText,errorsText:this.errorsText,sectionsLabel:this.sectionsLabel,sectionsAs:this.sectionsAs,sections:this.sections,selectedSection:this.selectedSection,editing:this.editing,changed:this.changed,errors:this.inputErrors.size?new Map([...this.errors,...this.inputErrors]):this.errors,inputsInvalid:this.inputErrors.size>0,controlErrors:this.controlErrors,canPickRecords:this.canPickRecords,canUploadFiles:this.canUploadFiles,hostSlot:e=>this.getSlotContent(e),hasHostSlot:e=>this.hasSlotContent(e),address:this.address,stackDepth:this.stackDepth,drawerWidth:this.drawerWidth,sectionsWidth:k,isTopPanel:this.isTopPanel,conflict:this.conflict,confirmation:this.confirmation,confirmSaveText:(0,d.pageText)(V,"confirmSaveText",this),keepEditingText:(0,d.pageText)(V,"keepEditingText",this),message:this.message,visible:e=>this.visible(e),conditionedField:e=>this.conditionedField(e),fieldDisabled:e=>this.fieldDisabled(e),canConfigureView:this.canConfigureView,configuring:this.configuring,unplaced:this.unplaced,viewTarget:this.viewTarget,editableLayers:this.editableLayers,viewProfiles:this.viewProfiles,viewProfile:this.viewProfile,canDeleteViewProfile:e=>this.canDeleteViewProfile(e),layerDenied:e=>this.layerDenied(e),canChangeVisibility:e=>this.canChangeVisibility(e),entryError:(e,t)=>this.entryError(e,t),configureText:this.configureText,doneConfiguringText:this.doneConfiguringText,resetViewText:this.resetViewText,resetViewAskText:this.resetViewAskText,cancelConfiguringText:this.cancelConfiguringText,resetAsked:this.resetAsked,personalLayerText:this.personalLayerText,viewProfileLabel:this.viewProfileLabel,addViewText:this.addViewText,newViewText:this.newViewText,deleteViewText:this.deleteViewText,lastSharedViewText:this.lastSharedViewText,sharedLayerText:this.sharedLayerText,widthText:this.widthText,fieldLabelText:this.fieldLabelText,sectionIcons:this.sectionIcons,sectionIconChoices:this.sectionIconChoices,sectionIconText:this.sectionIconText,variantText:this.variantText,hintText:this.hintText,hiddenText:this.hiddenText,configureHintText:this.wide?this.configureHintText:this.configureHintNarrowText,fieldSettingsText:this.fieldSettingsText,shownText:this.shownText,showRareText:this.showRareText,hideRareText:this.hideRareText,rareText:this.rareText,unplacedTitle:this.unplacedTitle,moveUpText:this.moveUpText,moveDownText:this.moveDownText,addFieldText:this.addFieldText,canOpenFullPage:this.canOpenFullPage,groupAt:e=>this.groupAt(e),groupCount:this.groupCount,fieldChoices:e=>this.fieldChoices(e),addSearch:this.addSearch,inThisGroupText:this.inThisGroupText,renameText:this.renameText,saveNameText:this.saveNameText,cancelNameText:this.cancelNameText,removeFieldText:this.removeFieldText,removeGroupText:this.removeGroupText,removeSectionText:this.removeSectionText,addGroupText:this.addGroupText,addSectionText:this.addSectionText,newGroupTitle:this.newGroupTitle,newSectionTitle:this.newSectionTitle,renaming:this.renaming,namingView:this.namingView,noMatchText:this.noMatchText,unplacedHintText:this.unplacedHintText,panelMenuItems:this.panelMenuItems,collectionLabel:this.collectionLabel,collectionIcon:this.collectionIcon,favourite:this.favourite,favouriteLabel:this.favouriteLabel,menuLabel:this.menuLabel,addressUrl:this.addressUrl??this.address,copyFeedbackMs:_,linkCopiedLabel:this.linkCopiedLabel,closeLabel:this.closeLabel,copyLinkLabel:this.copyLinkLabel,openFullLabel:this.openFullLabel,inheritedText:this.inheritedText,wide:this.wide,edgeControlWidth:this.edgeControlWidth,edgeControlCount:this.edgeControlCount,phoneSection:this.phoneSection,phoneSectionLabel:this.phoneSectionLabel,backLabel:this.backLabel})}template(){return(0,h.$)(this.templateContext())}sfAwaitingData(){return"skeleton"===this.getAttribute("data-sf-first-paint")&&!this.panel&&(!this.record&&!this.loadFailure&&"error"!==this.getAttribute("data-state"))}_setState(e,t=""){const i="loading"===e&&"loading"===this.getAttribute("data-state")&&!this.record;this.setAttribute("data-state",e),this.setAttribute("aria-busy","loading"===e?"true":"false"),this.message=t,i||this.requestComponentUpdate("state"),this.dispatchEvent(new CustomEvent("sf-view-properties-state",{bubbles:!0,composed:!0,detail:{state:e,message:t}}))}async _raise(e,t,{stale:i=()=>!1}={}){if(!this.hostPort)return this._setState("error",(0,d.pageText)(V,"statePortNotConnected",this)),{answer:"unavailable",reason:"port-not-connected"};try{const r=await this.hostPort.raise(e,E(t),{});if(!this.isConnected||i())return null;if(!r||!["applied","conflict","refused","unavailable"].includes(r.answer))throw new TypeError("Host answer is not a declared port answer");return"applied"===r.answer&&Array.isArray(r.effects)&&r.effects.length&&globalThis.SF?.Composition?.publishEffects?.(r.effects,{origin:this}),r}catch(e){return!this.isConnected||i()?null:(this._setState("error",(0,d.pageText)(V,"stateLoadFailed",this)),{answer:"unavailable",reason:"host-threw",message:String(e?.message||e)})}}get readsByGroup(){return Boolean(this.hostPort?.capabilities?.includes("group-load"))&&"create"!==this.mode}async load(e="requested"){this._setState("loading",(0,d.pageText)(V,"stateLoading",this)),this.loadFailure=null;const t=++this.epoch,i="create"===this.mode,r=this.readsByGroup;r&&(this.groupEpoch+=1,this.groupReads=new Map,this.groupsReading=new Set);const n=r?await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,group:null,reason:e},{stale:()=>t!==this.epoch}):await this._raise("record.load",{record_id:i?null:this.recordId||null,collection:this.collection||null,reason:e,...i?{mode:"create"}:{}},{stale:()=>t!==this.epoch});if(!n)return null;if("applied"!==n.answer&&!i&&!this.recordId)return n;if("applied"!==n.answer)return this.loadFailure={kind:"refused"===n.answer?"no-access":"error",text:n.message||""},this._setState("error",n.message||(0,d.pageText)(V,"stateUnavailable",this)),this.sfEmit("failed",{reason:String(n.reason??""),message:String(n.message??"")}),n;this.record=r?{...n.record??{},revision:n.revision??n.record?.revision??null}:n.record??null,this.sections=[],this._takeSections(this.record),this.view=n.record?.view??null;const s=this.editableLayers;s.includes(this.viewTarget)||(this.viewTarget=s[0]??"personal"),s.length||(this.configuring=!1),this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this.entryErrors=new Map;const o=this.sections.some(e=>String(e.key)===this.selectedSection),a=r&&void 0!==n.group&&null!==n.group?this.sections.find(e=>(e.groups??[]).some(e=>String(e.key)===String(n.group))):null;return o||(this.selectedSection=a?String(a.key):this.sections.length?String(this.sections[0].key):null),this._setState("ready"),r&&this._readShownGroups("started"),n}_takeSections(e){if(!Array.isArray(e?.sections))return;const t=E(e.sections);if(!this.readsByGroup)return void(this.sections=t);const i=void 0===e.revision||null===e.revision?"":String(e.revision),r=new Map(this.sections.flatMap(e=>(e.groups??[]).map(e=>[String(e.key),e])));for(const e of t){const t=Array.isArray(e.groups)?e.groups:[];t.forEach((e,n)=>{const s=String(e.key);if(!$(e))return void this.groupReads.set(s,i);const o=r.get(s);o&&this.groupReads.has(s)&&(t[n]={...e,fields:o.fields})})}this.sections=t}_shownGroups(){return(this.openAll||this.configuring?this.sections:this.sections.filter(e=>String(e.key)===this.selectedSection)).flatMap(e=>(e.groups??[]).map(t=>({section:String(e.key),group:String(t.key)})))}_readShownGroups(e="started",{force:t=!1}={}){if(!this.readsByGroup||!this.record)return[];const i=this.revision,r=[];for(const{section:n,group:s}of this._shownGroups())this.groupsReading.has(s)||this.groupsRefused.get(s)!==i&&(t||this.groupReads.get(s)!==i)&&r.push(this._readGroup(n,s,e));return r}async _readGroup(e,t,i){const r=this.groupEpoch;this.groupsReading.add(t),this.requestComponentUpdate("group-reading");const n=await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,section:e,group:t,reason:i},{stale:()=>r!==this.groupEpoch});if(r!==this.groupEpoch)return null;if(this.groupsReading.delete(t),!n)return null;if("refused"===n.answer&&"unknown-group"===n.reason){const e=this.revision;return this.groupsRefused.get(t)===e||(this.groupsRefused.set(t,e),await this.load("requested")),n}if("applied"!==n.answer)return this.requestComponentUpdate("group-reading"),n;const s=n.revision??n.record?.revision??this.record?.revision??null;return this.record={...this.record,...n.record??{},revision:s},this._takeSections(this.record),this.requestComponentUpdate("group-read"),n}isGroupReading(e){return this.groupsReading.has(String(e))}async _rereadAfterConflict(e){if(this.readsByGroup)return void 0!==e?.revision&&null!==e.revision&&this.record&&(this.record={...this.record,revision:e.revision}),Promise.all(this._readShownGroups("requested",{force:!0}));const t=this.epoch,i=await this._raise("record.load",{record_id:this.recordId||null,collection:this.collection||null,reason:"requested"},{stale:()=>t!==this.epoch});return i&&"applied"===i.answer&&i.record?(this.record=i.record,this._takeSections(i.record),this.requestComponentUpdate("conflict-reread"),i):i}get canUploadFiles(){return Boolean(this.hostPort?.capabilities?.includes("field-upload"))}getFieldUploads(e){return this.uploads.get(String(e.key??""))??[]}async startFieldUpload(e,t){const i=String(e.key??""),r=Array.isArray(t)?t:[];if(!r.length)return null;this.uploads.set(i,[...this.getFieldUploads(e),...r]),this.requestComponentUpdate("uploads");for(const t of r){const r=await this._raise("field.upload",{record_id:this.recordId||null,collection:this.collection||null,field:i,file:t.file??t},{stale:()=>!this.uploads.has(i)});if(!r)return null;const n=this.getFieldUploads(e);if("applied"===r.answer&&r.file){const s=this.changed.has(i)?this.changed.get(i):e.value,o=Array.isArray(s)?s:s?[s]:[];this.changed.set(i,[...o,r.file]),this.uploads.set(i,n.filter(e=>e!==t)),this.errors.delete(i)}else this.uploads.set(i,n.map(e=>e===t?{...e,state:"error",errorMessage:r.message||r.reason||""}:e)),"refused"===r.answer&&r.reason&&this.errors.set(i,String(r.message||r.reason));this.requestComponentUpdate("uploads")}return this}retryFieldUpload(e,t){const i=String(e.key??""),r=this.getFieldUploads(e),n=r[Number(t)];return n?(this.uploads.set(i,r.filter(e=>e!==n)),this.startFieldUpload(e,[n])):null}async openReference(e,t){if(!t||"object"!=typeof t)return null;const i=await this._raise("record.open",{record_id:this.recordId||null,collection:this.collection||null,field:String(e.key??""),value:t},{stale:()=>!this.isConnected});return this.sfEmit("open",{field:String(e.key??""),value:t,answer:i?.answer??null}),i}get stackDepth(){const e=A.indexOf(this);return e<0?0:e}get isTopPanel(){return F()===this}closePanel(e="close"){this._commitFocusedEntry();const t=this.unsavedFields;return this.sfEmit("close",{reason:e,record_id:this.recordId||null,unsaved_fields:t},{cancelable:!0})?{outcome:"applied"}:{outcome:"refused",reason:"prevented"}}get unsavedFields(){return new Set([...this.changed.keys(),...this.inputErrors.keys()]).size}_commitFocusedEntry(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;if(!e||"function"!=typeof e.blur)return;const t=this.panel?this.panelContent():null;(this.contains(e)||t?.contains(e))&&e.blur()}get addressUrl(){const e=this.address;if(!e)return null;try{return new URL(String(e),globalThis.location?.href).href}catch{return String(e)}}copyControl(){return[...document.querySelectorAll('sf-button-copy[data-action="copy-link"]')].find(e=>e.propertyView===this)??null}get addressCopied(){return"success"===this.copyControl()?.state?.phase}announceAddressCopy(e){const t=this.address;return this.dispatchEvent(new CustomEvent("sf-view-properties-address-copy",{bubbles:!0,composed:!0,detail:{address:t,url:this.addressUrl??t,copied:e,record_id:this.recordId||null}})),e}async copyAddress(){if(!this.address)return null;const e=this.copyControl();return e?.copy?Boolean(await e.copy()):null}openFullPage(){const e=this.address;return e?(this.sfEmit("open-full",{id:this.recordId||null,address:e,record_id:this.recordId||null}),this):null}openPhoneSection(e){const t=String(e);return!!this.sections.some(e=>String(e.key)===t)&&(this.phoneSection=t,this.selectSection(t),this.requestComponentUpdate("phone-section"),!0)}closePhoneSection(){return null!==this.phoneSection&&(this.phoneSection=null,this.requestComponentUpdate("phone-section"),!0)}get phoneSectionLabel(){const e=this.sections.find(e=>String(e.key)===this.phoneSection);return e?String(e.label??e.key):""}selectSection(e){return this.selectedSection=String(e),this.requestComponentUpdate("section"),this._readShownGroups("started"),this}get canPickRecords(){return Boolean(this.hostPort?.capabilities?.includes("field-options"))}getFieldOptionsPage(e){return this.optionPages.get(String(e.key??""))??null}getFieldOptionSearch(e){return this.optionSearches.get(String(e.key??""))??""}setFieldOptionSearch(e,t){return this.optionSearches.set(String(e.key??""),String(t??"")),this}async loadFieldOptions(e,{cursor:t=null,search:i="",quiet:r=!1}={}){const n=String(e.key??""),s=this.optionPages.get(n),o=t&&Array.isArray(s?.items)?s.items:[];this.optionPages.set(n,{items:o,status:"loading",quiet:r,nextCursor:s?.nextCursor??null}),this.requestComponentUpdate("options");const a=this.epoch,l=(this.optionEpochs.get(n)??0)+1;this.optionEpochs.set(n,l);const c=await this._raise("field.options",{record_id:this.recordId||null,collection:this.collection||null,field:n,cursor:t,search:String(i??""),...S(this.hostPort?.version,"1.14.0")?{...e.source?{source:String(e.source)}:{},limit:w}:{}},{stale:()=>a!==this.epoch||l!==this.optionEpochs.get(n)});if(!c)return null;if("applied"!==c.answer){const e="refused"===c.answer;return this.optionPages.set(n,{items:o,status:e?"unsupported":"error",quiet:!1,nextCursor:null}),this.requestComponentUpdate("options"),c}const u=c.options_page??{},d=Array.isArray(u.items)?u.items:[];return this.optionPages.set(n,{items:t?[...o,...d]:d,status:"ready",quiet:!1,nextCursor:u.next_cursor??null,total:u.total??null}),this.requestComponentUpdate("options"),c}changeField(e,t){const i=String(e.key??""),r=Object.hasOwn(e??{},"value")&&void 0!==t&&JSON.stringify(t)===JSON.stringify(e.value??null);return void 0===t||r?this.changed.delete(i):this.changed.set(i,t),this.errors.delete(i),this.confirmation=null,this.requestComponentUpdate("changed"),this}_clearInputs(){this.inputErrors.clear(),this.controlErrors.clear()}reportFieldError(e,t){const i=String(e?.key??"");if(!i)return this;const r=this.inputErrors.get(i);return t?(this.inputErrors.set(i,String(t)),this.controlErrors.add(i)):this.controlErrors.has(i)&&(this.inputErrors.delete(i),this.controlErrors.delete(i)),this.inputErrors.get(i)!==r&&this.requestComponentUpdate("errors"),this}fieldDisabled(e,t=this.fieldValues()){return Boolean(e?.when)&&!(0,f.tm)(e,t).enabled}_inputsInvalid(){return this.inputErrors.size?(this.requestComponentUpdate("errors"),{answer:"refused",reason:"input_invalid",errors:Object.fromEntries(this.inputErrors)}):null}_referenceFields(e,t){const i=this.sections.find(t=>String(t.key)===String(e)),r=this.visible(i?.groups).find(e=>String(e.key)===String(t));return this.visible(r?.fields,{conditions:!1}).filter(e=>x.includes(e.propertyType||e.type)).filter(e=>!("lookup"===(e.propertyType||e.type)&&Array.isArray(e.options)&&e.options.length>0))}editGroup(e,t){if(!this.mayEdit)return this;if(this.editing={section:String(e),group:String(t)},this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this.canPickRecords)for(const i of this._referenceFields(e,t))this.optionPages.has(String(i.key??""))||this.loadFieldOptions(i,{cursor:null,search:"",quiet:!0});return this}cancelEdit(){if(this.openAll)return this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode}})),this.panel?(this.closePanel("cancelled"),this):(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this);const e=this.editing;return this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),e&&this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode,scope:"group",section:e.section,group:e.group}})),this}announceSaved(e){const t=this.recordId||e?.record_id||e?.record?.record_id||null,i=e?.revision??e?.record?.revision??this.record?.revision??null;this.sfEmit("saved",{id:t,revision:null===i?"":String(i)})}async saveGroup({confirm:e=null}={}){if(this.openAll)return this.saveAll({confirm:e});if(this.editing&&this.inputErrors.size)return this._inputsInvalid();if(!this.editing||0===this.changed.size)return null;const t=this._savedValues();if(!Object.keys(t).length)return null;this.confirmation=null;const i=++this.epoch,r=await this._raise("group.save",{record_id:this.recordId||null,collection:this.collection||null,section:this.editing.section,group:this.editing.group,values:t,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>i!==this.epoch});return r?this._askedToConfirm(r)?r:"applied"===r.answer?(this.record=r.record?{...r.record,revision:r.revision??r.record.revision}:{...this.record,revision:r.revision??this.record?.revision??null},this._takeSections(this.record),this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this._setState("ready"),this.announceSaved(r),r):"conflict"===r.answer?(this.conflict=r.message||this.conflictText,this.requestComponentUpdate("conflict"),await this._rereadAfterConflict(r),r):"refused"===r.answer&&"unknown-group"===r.reason?(await this.load("requested"),r):"refused"===r.answer?(this.errors=new Map(Object.entries(r.errors??{}).map(([e,t])=>[e,String(t)])),this.requestComponentUpdate("errors"),r):(this._setState("error",r.message||(0,d.pageText)(V,"saveFailedText",this)),r):null}async saveAll({confirm:e=null}={}){if(this.inputErrors.size)return this._inputsInvalid();if("create"!==this.mode&&0===this.changed.size)return null;const t="create"===this.mode,i=this._savedValues();if(!t&&!Object.keys(i).length)return null;this.confirmation=null;const r=++this.epoch,n=t?await this._raise("record.create",{collection:this.collection||null,values:i},{stale:()=>r!==this.epoch}):await this._raise("record.save",{record_id:this.recordId||null,collection:this.collection||null,values:i,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>r!==this.epoch});if(!n)return null;if(!t&&this._askedToConfirm(n))return n;if("applied"===n.answer){if(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,t){const e=n.record_id??n.record?.record_id??null;return this.dispatchEvent(new CustomEvent("sf-view-properties-created",{bubbles:!0,composed:!0,detail:{record_id:e,collection:this.collection||null}})),null!==e&&(this.setAttribute("record-id",String(e)),this.setAttribute("mode","auto"),n.record?(this.record=n.record,this._takeSections(n.record),this.view=n.record.view??this.view,this._setState("ready")):await this.load("created")),n}return this.record=n.record??this.record,this._takeSections(n.record),this._setState("ready"),this.announceSaved(n),n}return"conflict"===n.answer?(this.conflict=n.message||this.conflictText,this.requestComponentUpdate("conflict"),n):"refused"===n.answer?(this.errors=new Map(Object.entries(n.errors??{}).map(([e,t])=>[e,String(t)])),!this.errors.size&&n.message&&(this.conflict=n.message),this.requestComponentUpdate("errors"),n):(this._setState("error",n.message||(0,d.pageText)(V,"saveFailedText",this)),n)}_askedToConfirm(e){const t=e?.confirm;return!("refused"!==e?.answer||"confirm_required"!==e.reason||!t||"string"!=typeof t.digest||!t.digest)&&(this.confirmation={text:String(t.summary||e.message||""),digest:t.digest},this.requestComponentUpdate("confirmation"),!0)}confirmSave(){const e=this.confirmation?.digest;return e?this.openAll?this.saveAll({confirm:e}):this.saveGroup({confirm:e}):Promise.resolve(null)}cancelConfirmation(){return this.confirmation=null,this.requestComponentUpdate("confirmation"),this}get canConfigureView(){return"view"!==this.mode&&(Boolean(this.hostPort?.capabilities?.includes?.("view-settings"))&&Boolean(this.view)&&this.editableLayers.length>0)}get viewProfiles(){const e=this.view?.profiles;return Array.isArray(e)?e.filter(e=>e&&"string"==typeof e.id&&e.id):[]}get viewProfile(){const e=this.view?.profile;return"string"==typeof e&&e?e:this.viewProfiles[0]?.id??null}canDeleteViewProfile(e){const t=this.viewProfiles,i=t.find(t=>t.id===String(e??""));return!!i&&(!i.shared||t.filter(e=>e.shared).length>1)}createViewProfile(e,{shared:t=!1}={}){const i=String(e??"").trim();return i?(this.namingView&&(this.namingView=!1,this.requestComponentUpdate("view-naming")),this._viewProfileIntent("view.create",{label:i,shared:Boolean(t),view:this.layerDraft??this._layerCopy(this.viewTarget)})):null}startNamingView(){return this.namingView=!0,this.requestComponentUpdate("view-naming"),!0}cancelNamingView(){this.namingView=!1,this.requestComponentUpdate("view-naming")}renameViewProfile(e,t){const i=String(t??"").trim(),r=String(e??"");return i&&r&&this.viewProfiles.some(e=>e.id===r)?this._viewProfileIntent("view.rename",{profile:r,label:i}):null}deleteViewProfile(e){const t=String(e??"");return this.canDeleteViewProfile(t)?this._viewProfileIntent("view.delete",{profile:t}):null}async _viewProfileIntent(e,t){const i=++this.epoch,r=await this._raise(e,{record_id:this.recordId||null,collection:this.collection||null,...t},{stale:()=>i!==this.epoch});return r?"applied"!==r.answer?(this._setState("error",r.message||this.viewDeniedText),r):(this.record=r.record??this.record,this._takeSections(r.record),this.view=r.record?.view??this.view,this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this._setState("ready"),this.requestComponentUpdate("profiles"),r):null}async selectViewProfile(e){const t=String(e??"");if(!t||t===this.viewProfile)return null;if(!this.viewProfiles.some(e=>e.id===t))return null;const i=++this.epoch,r=await this._raise("view.profile",{record_id:this.recordId||null,collection:this.collection||null,profile:t},{stale:()=>i!==this.epoch});return r?"applied"!==r.answer?(this._setState("error",r.message||this.viewDeniedText),r):(this.record=r.record??this.record,this._takeSections(r.record),this.view=r.record?.view??this.view,this.editing=null,this.changed.clear(),this._clearInputs(),this._setState("ready"),this.configuring&&this.setViewTarget(this._layerOfProfile()),this.requestComponentUpdate("profile"),r):null}get editableLayers(){const e=this.view?.editable;return Array.isArray(e)?e.filter(e=>"personal"===e||"shared"===e):[]}layerDenied(e){return this.editableLayers.includes(e)?null:this.view?.denied?.[e]||this.viewDeniedText}_emptyLayer(){return{schema_version:1,sections:{},groups:{},fields:{}}}_layerCopy(e){const t=this.view?.layers?.[e]?.view;return t?E(t):this._emptyLayer()}_layerRevision(e){const t=this.view?.layers?.[e];return t?t.revision??null:null}toggleShowRare(){return this.toggleAttribute("show-rare",!this.showRare),this.requestComponentUpdate("show-rare"),this.showRare}get hasRare(){const e=e=>(e??[]).some(e=>!0===e?.rare);return(this.sections??[]).some(t=>!0===t?.rare||e(t?.groups)||(t?.groups??[]).some(t=>e(t?.fields)))}_layerOfProfile(){const e=this.viewProfiles.find(e=>e.id===this.viewProfile),t=e?.shared?"shared":"personal";return this.editableLayers.includes(t)?t:this.viewTarget}startConfiguringView(){return!!this.canConfigureView&&(this.configuring=!0,this.viewProfiles.length&&(this.viewTarget=this._layerOfProfile()),this.arrangementEntered={kind:this.viewTarget,revision:this._layerRevision(this.viewTarget),view:this._layerCopy(this.viewTarget)},this.resetAsked=!1,this.layerDraft=this._layerCopy(this.viewTarget),this._bindSectionDropTarget(),this.entryErrors=new Map,this.cancelEdit(),this.requestComponentUpdate("configuring"),this._readShownGroups("started"),this._focusAfterRender(['.sf-property-view-configure-bar [data-action="view-profile"]',".sf-property-view-configure-bar"]),!0)}stopConfiguringView(){const e=this.configuring;this.configuring=!1,this._bindSectionDropTarget(),this.layerDraft=null,this.arrangementEntered=null,this.resetAsked=!1,this.entryErrors=new Map,this.requestComponentUpdate("configuring"),e&&this._focusAfterRender('[data-action="menu"]')}_focusAfterRender(e){const t=e=>(e?.matches?.(p.FOCUSABLE)?e:e?.querySelector?.(p.FOCUSABLE))??null;this.whenRendered(()=>requestAnimationFrame(async()=>{const i=this.panelContent?.()??this;let r=null;for(const n of[e].flat()){const e=[...i?.querySelectorAll?.(n)??[]].pop()??null;if(e&&(r=t(e),!r&&e.localName.includes("-")&&(await customElements.whenDefined(e.localName),await(e.whenRendered?.()),await new Promise(e=>requestAnimationFrame(e)),r=t(e)),r))break}if(!r||!r.isConnected)return;const n=document.activeElement;n&&n!==document.body&&i?.contains?.(n)||r.focus({preventScroll:!0})}),{next:!0})}async cancelConfiguringView(){if(!this.configuring)return!1;const e=this.arrangementEntered;if(!e||e.kind!==this.viewTarget)return this.stopConfiguringView(),!0;const t=(e,t)=>JSON.stringify(e)===JSON.stringify(t),i=this._layerCopy(e.kind);if(null!=e.revision&&this._layerRevision(e.kind)===e.revision||t(i,e.view))return t(this.layerDraft,e.view)||await this.load("view-cancel"),this.stopConfiguringView(),!0;this.layerDraft=E(e.view);const r=await this.saveView();return await this.load("view-cancel"),this.stopConfiguringView(),r}askReset(){return!!this.configuring&&(this.resetAsked=!0,this.requestComponentUpdate("reset-ask"),!0)}cancelReset(){return this.resetAsked=!1,this.requestComponentUpdate("reset-ask"),!0}setViewTarget(e){return!(!this.editableLayers.includes(e)||e===this.viewTarget)&&(this.viewTarget=e,this.layerDraft=this._layerCopy(e),this.entryErrors=new Map,this.requestComponentUpdate("view-target"),!0)}canChangeVisibility(e){const t=e?.hiddenBy??null;return!t||"package"!==t&&("shared"!==t||"shared"===this.viewTarget)}entryError(e,t){return this.entryErrors.get(`${e}:${t}`)??null}_groupsOf(e){const t=this.sections.find(t=>String(t.key)===String(e));return Array.isArray(t?.groups)?t.groups:[]}_fieldsOf(e){for(const t of this.sections)for(const i of t.groups??[])if(String(i.key)===String(e))return Array.isArray(i.fields)?i.fields:[];return[]}_locateGroup(e){for(const t of this.sections)for(const i of t.groups??[])if(String(i.key)===String(e))return{section:t,group:i};return null}_writeOrder(e,t,i={}){t.forEach((t,r)=>{const n=String(t.key);e[n]={...e[n]??{},...i,order:r+1}})}moveFieldToSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const i=(this.sections??[]).find(e=>String(e.key)===String(t));if(!i)return!1;const r=(i.groups??[]).find(e=>"related"!==e.kind);return!!r&&this.moveField(e,String(r.key),(r.fields??[]).length)}_bindSectionDropTarget(){if(!this.configuring)return this._releaseSectionTarget?.(),void(this._releaseSectionTarget=null);if(this._releaseSectionTarget)return;const e=globalThis.SF?.Sortable?.registerSortableDropTarget;if("function"!=typeof e)return;const t=(e,t)=>{const i=globalThis.document?.elementFromPoint?.(e,t),r=i?.closest?.("[data-section-tab], .sf-tree-item[data-value]"),n=this.panelContent();return r&&n&&n.contains(r)?r:null};this._releaseSectionTarget=e({resolve:(e,i,r)=>{if(r?.group&&!["field","group"].includes(r.group))return null;const n=t(e,i);if(!n)return null;const s=n.getAttribute("data-section-tab")??n.getAttribute("data-value");if(s===this.selectedSection)return null;return{descriptor:{section:s},rect:(n.matches("[data-section-tab]")?n:n.querySelector(":scope > .sf-tree-item-container")||n).getBoundingClientRect(),label:n.querySelector(":scope > .sf-tree-item-container > .sf-tree-item-name")?.textContent?.trim()||n.textContent?.trim()||s}},drop:(e,t)=>!!t?.section&&("group"===e?.group?this.moveGroup(e?.item,t.section,Number.MAX_SAFE_INTEGER):this.moveFieldToSection(e?.item,t.section))})}moveField(e,t,i){if(!this.configuring||!this.layerDraft)return!1;const r=this._locateGroup(t);if(!r)return!1;let n=null,s=null;for(const t of this.sections){for(const i of t.groups??[]){const t=(i.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){s=i,[n]=i.fields.splice(t,1);break}}if(n)break}let o=!1;if(!n){const t=this.record?.unplaced??[],i=t.findIndex(t=>String(t.key)===String(e));i>=0&&([n]=t.splice(i,1),o=!0)}if(!n)return!1;const a=r.group.fields??(r.group.fields=[]),l=Math.max(0,Math.min(Number.isInteger(i)?i:a.length,a.length));return a.splice(l,0,n),this._writeOrder(this.layerDraft.fields,a,{group:String(t)}),o&&this._writeOrder(this.layerDraft.fields,this.record?.unplaced??[],{group:null}),s&&s!==r.group&&this._writeOrder(this.layerDraft.fields,s.fields??[],{group:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}moveGroup(e,t,i){if(!this.configuring||!this.layerDraft)return!1;const r=this.sections.find(e=>String(e.key)===String(t));if(!r)return!1;let n=null,s=null;for(const t of this.sections){const i=(t.groups??[]).findIndex(t=>String(t.key)===String(e));if(i>=0){s=t,[n]=t.groups.splice(i,1);break}}if(!n)return!1;const o=r.groups??(r.groups=[]),a=Math.max(0,Math.min(Number.isInteger(i)?i:o.length,o.length));return o.splice(a,0,n),this._writeOrder(this.layerDraft.groups,o,{section:String(t)}),s&&s!==r&&this._writeOrder(this.layerDraft.groups,s.groups??[],{section:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}setFieldView(e,t={}){if(!this.configuring||!this.layerDraft)return!1;const i=["width","variant","hint","label"],r=Object.fromEntries(Object.entries(t).filter(([e])=>i.includes(e)));if(!Object.keys(r).length)return!1;const n=String(e);this.layerDraft.fields[n]={...this.layerDraft.fields[n]??{},...r};for(const e of this.sections)for(const t of e.groups??[])for(const e of t.fields??[])String(e.key)===n&&Object.assign(e,r);return this.requestComponentUpdate("view-field"),this.saveView()}get sectionIcons(){return this.getAttribute("section-icons")||""}get sectionIconChoices(){const e=this.sectionIcons;return e?e.split(/[\s,]+/u).filter(Boolean):L}setSectionIcon(e,t){if(!this.configuring||!this.layerDraft)return!1;const i=String(e),r=this.sections.find(e=>String(e.key)===i);if(!r)return!1;const n=String(t??"").trim()||null;return this.layerDraft.sections[i]={...this.layerDraft.sections[i]??{},icon:n},r.icon=n,this.requestComponentUpdate("view-section-icon"),this.saveView()}renameEntry(e,t,i){if(!this.configuring||!this.layerDraft)return!1;const r={section:"sections",group:"groups"}[e];if(!r)return!1;const n=String(i??"").trim();if(!n)return!1;const s=this._findEntry(e,t);if(!s)return!1;const o=String(t);return this.layerDraft[r][o]={...this.layerDraft[r][o]??{},label:n},s.label=n,this.renaming=null,this.requestComponentUpdate("view-rename"),this.saveView()}startRenaming(e,t){return!!this.configuring&&(this.renaming={kind:e,key:String(t)},this.requestComponentUpdate("view-rename"),!0)}cancelRenaming(){this.renaming=null,this.requestComponentUpdate("view-rename")}removeGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this._locateGroup(e);if(!t||!this.canChangeVisibility(t.group))return!1;for(const e of[...t.group.fields??[]])this.moveFieldToUnplaced(String(e.key));const i=String(e);this.layerDraft.groups[i]={...this.layerDraft.groups[i]??{},hidden:!0},t.group.hidden=!0;const r=this.sections.find(e=>(e.groups??[]).includes(t.group));return r&&(r.groups=(r.groups??[]).filter(e=>e!==t.group)),this.requestComponentUpdate("view-remove-group"),this.saveView()}removeSection(e){if(!this.configuring||!this.layerDraft)return!1;const t=String(e),i=this.sections.find(e=>String(e.key)===t);if(!i||!this.canChangeVisibility(i))return!1;if(this.sections.length<2)return!1;const r=this.sections.find(e=>e!==i);for(const e of[...i.groups??[]])this.moveGroup(String(e.key),String(r.key),Number.MAX_SAFE_INTEGER);return this.layerDraft.sections[t]={...this.layerDraft.sections[t]??{},hidden:!0},i.hidden=!0,this.sections=this.sections.filter(e=>e!==i),this.selectedSection===t&&(this.selectedSection=String(r.key)),this.requestComponentUpdate("view-remove-section"),this.saveView()}moveSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const i=String(e),r=this.sections.findIndex(e=>String(e.key)===i);if(r<0)return!1;const n=[...this.sections],[s]=n.splice(r,1),o=Math.max(0,Math.min(Number.isInteger(t)?t:n.length,n.length));return n.splice(o,0,s),!n.every((e,t)=>e===this.sections[t])&&(this.sections=n,this._writeOrder(this.layerDraft.sections,this.sections,{}),this.requestComponentUpdate("view-move-section"),this.saveView())}addGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this.sections.find(t=>String(t.key)===String(e))??this.sections[0];if(!t)return!1;const i=this._newEntryKey("group"),r={key:i,label:this.newGroupTitle,columns:1,fields:[],hidden:!1,rare:!1,editable:!0};return t.groups=[...t.groups??[],r],this._writeOrder(this.layerDraft.groups,t.groups,{section:String(t.key)}),this.layerDraft.groups[i]={...this.layerDraft.groups[i]??{},label:r.label,section:String(t.key),columns:1,hidden:!1},this.renaming={kind:"group",key:i},this.requestComponentUpdate("view-add-group"),this.saveView()}addSection(){if(!this.configuring||!this.layerDraft)return!1;const e=this._newEntryKey("section"),t={key:e,label:this.newSectionTitle,groups:[],hidden:!1,rare:!1};return this.sections=[...this.sections,t],this._writeOrder(this.layerDraft.sections,this.sections,{}),this.layerDraft.sections[e]={...this.layerDraft.sections[e]??{},label:t.label,hidden:!1},this.selectedSection=e,this.renaming={kind:"section",key:e},this.requestComponentUpdate("view-add-section"),this.saveView()}_newEntryKey(e){return`view-${e}-${Date.now().toString(36)}${Math.floor(46655*Math.random()).toString(36).padStart(3,"0")}`}toggleEntryHidden(e,t){if(!this.configuring||!this.layerDraft)return!1;const i={section:"sections",group:"groups",field:"fields"}[e];if(!i)return!1;const r=this._findEntry(e,t);if(!r||!this.canChangeVisibility(r))return!1;const n=!r.hidden,s=String(t);return this.layerDraft[i][s]={...this.layerDraft[i][s]??{},hidden:n},r.hidden=n,this.requestComponentUpdate("view-hidden"),this.saveView()}_findEntry(e,t){const i=String(t);for(const t of this.sections){if("section"===e&&String(t.key)===i)return t;for(const r of t.groups??[]){if("group"===e&&String(r.key)===i)return r;for(const t of r.fields??[])if("field"===e&&String(t.key)===i)return t}}return null}async saveView(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this._viewWriting??Promise.resolve();let t;this._viewWriting=new Promise(e=>{t=e});try{return await e,await this._saveViewNow()}finally{t()}}async _saveViewNow(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this.viewTarget,t=++this.viewEpoch,i=await this._raise("view.save",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)},view:E(this.layerDraft)},{stale:()=>t!==this.viewEpoch});return i?"applied"===i.answer?(this.entryErrors=new Map,this._storeLayer(e,i.revision??null,i.view??this.layerDraft),i.view?await this.load("view-normalised"):(this._setState("ready"),this.requestComponentUpdate("view-saved")),i):"conflict"===i.answer?(this._storeLayer(e,i.revision??null,i.view??null),this.message=i.message||this.viewConflictText,await this.load("view-conflict"),i):"refused"===i.answer?(this.entryErrors=new Map(Object.entries(i.entry_errors??{}).map(([e,t])=>[e,String(t)])),await this.load("view-refused"),i):(this._setState("error",i.message||(0,d.pageText)(V,"viewSaveFailedText",this)),i):null}_storeLayer(e,t,i){this.view&&(this.view.layers={...this.view.layers??{}},this.view.layers[e]={revision:t,view:i?E(i):null},this.layerDraft=this._layerCopy(e))}async resetView(){if(!this.canConfigureView)return null;this.resetAsked=!1,await(this._viewWriting??Promise.resolve());const e=this.viewTarget,t=++this.viewEpoch,i=await this._raise("view.reset",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)}},{stale:()=>t!==this.viewEpoch});return i?"applied"===i.answer||"conflict"===i.answer?("conflict"===i.answer&&(this.message=i.message||this.viewConflictText),this._storeLayer(e,i.revision??null,null),this.entryErrors=new Map,await this.load("view-reset"),i):(this._setState("error",i.message||(0,d.pageText)(V,"viewResetFailedText",this)),i):null}}(0,s.C3)(O,o),(0,s.l6)(O,o),O.define("sf-view-properties"),t()}catch(D){t(D)}})},"844bdc4d24eb"(e,t,i){i.d(t,{tm:()=>o});const r=Object.freeze(["eq","ne","in","not_in","empty","not_empty"]),n=e=>e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;function s(e,t){if(!e||"object"!=typeof e||Array.isArray(e))return null;for(const i of["all","any"]){if(!(i in e))continue;const r=e[i];if(!Array.isArray(r)||!r.length)return null;const n=r.map(e=>s(e,t));return n.includes(null)?null:"all"===i?n.every(Boolean):n.some(Boolean)}if("not"in e){const i=s(e.not,t);return null===i?null:!i}if("string"!=typeof e.field||!r.includes(e.op))return null;const i=(o=t.get(e.field),(Array.isArray(o)?o:[o]).map(n).filter(e=>null!=e&&""!==e).map(e=>String(e)));var o;if("empty"===e.op)return 0===i.length;if("not_empty"===e.op)return i.length>0;if("eq"===e.op||"ne"===e.op){const t=i.includes(String(n(e.value)));return"eq"===e.op?t:!t}if(!Array.isArray(e.value))return null;const a=e.value.map(e=>String(n(e))),l=i.some(e=>a.includes(e));return"in"===e.op?l:!l}function o(e,t){const i=e?.when&&"object"==typeof e.when?e.when:null,r=e=>i&&e in i?s(i[e],t):null,n=r("visible"),o=r("required"),a=r("enabled");return{visible:n??!0,required:o??!0===e?.required,enabled:a??!0}}},"40b137e60526"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{$:()=>X});var n=i("2a080a730149"),s=i("e5483002f3ea"),o=e([n,s]);[n,s]=o.then?(await o)():o;function a(e,t,i,{disabled:r=!1}={}){const o=String(t.key??""),a={setFieldValue:(t,i)=>e.component.changeField(t,i),setFieldError:(t,i)=>e.component.reportFieldError(t,i),...e.canUploadFiles?{getFieldUploads:t=>e.component.getFieldUploads(t),startFieldUpload:(t,i)=>e.component.startFieldUpload(t,i),retryFieldUpload:(t,i)=>e.component.retryFieldUpload(t,i)}:{},...e.canPickRecords?{getFieldOptionsPage:t=>e.component.getFieldOptionsPage(t),getFieldOptionSearch:t=>e.component.getFieldOptionSearch(t),setFieldOptionSearch:(t,i)=>e.component.setFieldOptionSearch(t,i),loadFieldOptions:(t,i)=>e.component.loadFieldOptions(t,i)}:{}},l=i?(0,s.z4)(t,e.changed.has(o)?e.changed.get(o):t.value,a,{size:e.size,...r?{disabled:!0}:{}}):(0,s.oX)(t,t.value,e.viewHost,{size:e.size}),c=["record","relation","user"].includes(t.propertyType||t.type)&&t.value&&"object"==typeof t.value;if(!i&&c&&l)return n.html`<span
576
+ `}const lt={string:ie,text:Xe,html:Ze,integer:Qe,number:Qe,date:et,datetime:et,time:et,boolean:tt,choice:nt,choices:it,user:rt,record:st,relation:st,lookup:ot,file:at,color:C,include:oe};function ct(e={},t,n,i={}){const r=e.propertyType||e.type||e.dataType,s=lt[r];if(!s)return null;const o=He;He=Ue(i);try{return s(e,t,n)}finally{He=o}}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.fieldRenderers={...window.SF.fieldRenderers||{},renderCellField:W,renderEditField:We,renderFilterField:k,renderViewField:ct,FILTER_RENDERERS:$,dateTime:{split:c.AC,compose:c.cy,normalizeTime:c.d2,splitTime:c.SB,composeTime:c.MC},registry:l.u.map(e=>{return{...e,modes:(t=e.type,(0,l.U)(t,{view:lt,edit:K,cell:P,filter:$}))};var t})},globalThis.document?.dispatchEvent?.(new CustomEvent("sf-field-renderers-ready"))),i()}catch(ut){i(ut)}})},dd6973f77245(e,t,n){n.d(t,{$:()=>a,C:()=>l});const i={0:"\\d",a:"\\p{L}","*":"[\\s\\S]"},r={0:e=>/\d/u.test(e),a:e=>/\p{L}/u.test(e),"*":()=>!0},s=e=>e.replace(/[\\^$.*+?()[\]{}|/]/gu,"\\$&");const o=new Map;function a(e){const t=e?.mask;return"string"==typeof t&&""!==t?t:null}function l(e,t,n="_"){const a=String(e??"");o.has(t)||o.set(t,function(e){let t="";const n=[];for(let o=0;o<e.length;o+=1){const a=e[o];"\\"===a?(o+=1,o<e.length&&(t+=s(e[o]),n.push({fixed:e[o]}))):"{"===a||"}"===a||"["===a||"]"===a||(i[a]?(t+=i[a],n.push({test:r[a]})):(t+=s(a),n.push({fixed:a})))}return{complete:new RegExp(`^${t}$`,"u"),tokens:n}}(t));const{complete:l,tokens:c}=o.get(t);return l.test(a)?"complete":0===function(e,t,n){let i=0,r=0;for(const s of e){for(;r<t.length&&void 0!==t[r].fixed&&t[r].fixed!==s;)r+=1;if(r>=t.length)break;const e=t[r];void 0!==e.fixed||s===n?r+=1:e.test(s)&&(i+=1,r+=1)}return i}(a,c,n)?"empty":"incomplete"}},fc654eb7fab0(e,t,n){n.d(t,{U:()=>r});const i=Object.freeze([{type:"string",label:{ru:"Строка",en:"String"},variants:[{id:"phone",label:{ru:"Телефон",en:"Phone"}},{id:"password",label:{ru:"Пароль",en:"Password"},writeOnly:!0}],params:["placeholder","mask","nullable","required","readonly"]},{type:"text",label:{ru:"Текст",en:"Text"},variants:[],params:["placeholder","required","readonly"]},{type:"html",label:{ru:"Форматированный текст",en:"Formatted text"},variants:[],params:["placeholder","required","readonly"]},{type:"integer",label:{ru:"Целое число",en:"Integer"},variants:[{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","required","readonly"]},{type:"number",label:{ru:"Число",en:"Number"},variants:[{id:"scale",label:{ru:"Шкала 0–100",en:"Scale 0–100"}},{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","precision","required","readonly"]},{type:"date",label:{ru:"Дата",en:"Date"},variants:[],params:["required","readonly"]},{type:"datetime",label:{ru:"Дата и время",en:"Date and time"},variants:[],params:["min","max","step","required","readonly"]},{type:"time",label:{ru:"Время",en:"Time"},variants:[],params:["min","max","step","required","readonly"]},{type:"boolean",label:{ru:"Да или нет",en:"Yes or no"},variants:[],params:["trueText","falseText","required","readonly"]},{type:"choice",label:{ru:"Одно из списка",en:"One of a list"},variants:[{id:"buttons",label:{ru:"Кнопками",en:"As buttons"}}],params:["options","badgeAppearance","size","required","readonly"]},{type:"choices",label:{ru:"Несколько из списка",en:"Several of a list"},variants:[{id:"badges",label:{ru:"Значками",en:"As badges"}},{id:"checklist",label:{ru:"Флажками",en:"As a checklist"}},{id:"select",label:{ru:"Выпадающим списком",en:"As a dropdown"}}],params:["options","badgeAppearance","required","readonly"]},{type:"user",label:{ru:"Пользователь",en:"User"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"record",label:{ru:"Запись",en:"Record"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"relation",label:{ru:"Связь",en:"Relation"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"lookup",label:{ru:"Из справочника",en:"From a reference list"},variants:[],params:["options","multiple","placeholder","searchPlaceholder","required","readonly"]},{type:"file",label:{ru:"Файл",en:"File"},variants:[{id:"image",label:{ru:"Изображение",en:"Image"}},{id:"image-card",label:{ru:"Изображение карточкой",en:"Image card"}},{id:"image-list",label:{ru:"Изображения списком",en:"Image list"}}],params:["accept","multiple","formats","uploadText","uploadSupportingText","uploadHint","required","readonly"]},{type:"color",label:{ru:"Цвет",en:"Colour"},variants:[],params:["swatches","required","readonly"]},{type:"include",label:{ru:"Код",en:"Code"},variants:[],params:["language","required","readonly"]}]);function r(e,t){return{view:Boolean(t.view?.[e]),edit:Boolean(t.edit?.[e]),cell:t.cell?.[e]?"own":"text",filter:t.filter?.[e]?"own":"text"}}n.d(t,["u",0,i])},"5961360f41f4"(e,t,n){n.d(t,{f:()=>c});const i=Object.freeze(["main","tonal","outline"]),r=Object.freeze(["neutral","primary","secondary","tertiary","info","success","warning","error","on-surface"]),s=Object.freeze({danger:"error"}),o=Object.freeze(["1/3","1/2","1"]);function a(e){const t=String(e??"").trim().toLowerCase(),n=s[t]??t;return r.includes(n)?n:""}Object.freeze(r.flatMap(e=>i.filter(t=>!("on-surface"===e&&"tonal"===t)).flatMap(t=>o.map(n=>Object.freeze({type:t,scheme:e,size:n})))));const l=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function c(e={}){const t=e?.scheme??e?.color,n="string"==typeof t?t.trim():"",i=a(n);return i?{scheme:i,rootStyle:""}:l.test(n)?{scheme:"neutral",rootStyle:`--sf-badge--background-color: color-mix(in srgb, ${n} 24%, transparent); --sf-badge--color: var(--sf-on-surface)`}:{scheme:"neutral",rootStyle:""}}},"7623a90f1816"(e,t,n){n.a(e,async(e,t)=>{try{var i=n("deb1a4d61565"),r=n("5b7d7695b41b"),s=n("17828be41e75"),o=n("3ea81f4c3c20"),a=n("4284cc8c32e1"),l=n("99fb492b7fba"),c=n("d614908e644f"),u=n("1b42c5117087"),d=n("43090d1c8307"),p=n("18003344cff0"),h=n("40b137e60526"),f=n("844bdc4d24eb"),g=n("2f31b00ad99a"),m=e([i,r,d,p,h,g]);[i,r,d,p,h,g]=m.then?(await m)():m;var v=n.n(i);const y=["1.0.0","1.1.0","1.2.0","1.3.0","1.4.0","1.5.0","1.6.0","1.7.0","1.8.0","1.9.0","1.10.0","1.11.0","1.12.0","1.13.0","1.14.0","1.15.0","1.16.0","1.17.0"],b=["view","auto","edit","create"],w=20,x=["record","relation","user","lookup"],$=e=>Number.isInteger(e?.field_count)&&e.field_count>0&&(!Array.isArray(e.fields)||0===e.fields.length),k=(e,t)=>{const n=e=>String(e??"").split(".").map(e=>Number.parseInt(e,10)||0),[i,r]=[n(e),n(t)];for(let e=0;e<3;e+=1)if((i[e]??0)!==(r[e]??0))return(i[e]??0)>(r[e]??0);return!0},S="(min-width: 48rem)",T="14rem",_=5e3,A=[];function F(){return A[A.length-1]??null}function C(){A.forEach((e,t)=>{e.setAttribute("data-stack-depth",String(t)),e.toggleAttribute("data-stack-top",e===F()),e.requestComponentUpdate("stack")})}const z=e=>null===e||["string","number","boolean","undefined"].includes(typeof e)||"object"==typeof e&&(Array.isArray(e)||e.constructor===Object),E=e=>null==e?e:"object"==typeof e&&z(e)?Array.isArray(e)?e.map(e=>E(e)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,E(t)])):e,q=(e={})=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase()),t])),L={en:q(l.runtime),ru:q(c.runtime)},O=u.x,P=(0,r.elementFromManifest)(o,{base:v(),lang:{en:l,ru:c},source:"ru",aliases:a});class V extends P{static get props(){return{templateName:{attribute:"template",default:"default"},recordId:{attribute:"record-id",default:""},collection:{default:""},showRare:{attribute:"show-rare",type:Boolean,default:!1},size:{default:"1"},mode:{default:"auto"},emptyText:{attribute:"empty-text",default:"not filled in"},emptyRecordText:{attribute:"empty-record-text",default:"This record has nothing to show"},editText:{attribute:"edit-text",default:"edit"},saveText:{attribute:"save-text",default:"Save"},cancelText:{attribute:"cancel-text",default:"Cancel"},deleteText:{attribute:"delete-text",default:"Delete"},changedText:{attribute:"changed-text",default:"Fields changed"},errorsText:{attribute:"errors-text",default:"Errors"},conflictText:{attribute:"conflict-text",default:"The record changed; read it again"},sectionsLabel:{attribute:"sections-label",default:"Sections"},sectionsAs:{attribute:"sections-as",default:"list",values:["list","tabs"]},panel:{type:Boolean,default:!1},panelSize:{attribute:"panel-size",default:"1",values:["1/2","1","2","full"]},panelLabel:{attribute:"panel-label",default:""},panelWidth:{attribute:"panel-width",default:""},closeLabel:{attribute:"close-label",default:"Close"},copyLinkLabel:{attribute:"copy-link-label",default:"Copy link"},linkCopiedLabel:{attribute:"link-copied-label",default:"Link copied"},openFullLabel:{attribute:"open-full-label",default:"Open as a page"},configureText:{attribute:"configure-text",default:"Arrange the view"},doneConfiguringText:{attribute:"done-configuring-text",default:"Done"},resetViewText:{attribute:"reset-view-text",default:"Reset"},resetViewAskText:{attribute:"reset-view-ask-text",default:"Reset the whole view?"},cancelConfiguringText:{attribute:"cancel-configuring-text",default:"Cancel"},personalLayerText:{attribute:"personal-layer-text",default:"Personal"},viewProfileLabel:{attribute:"view-profile-label",default:"View"},addViewText:{attribute:"add-view-text",default:"Add a view"},newViewText:{attribute:"new-view-text",default:"New view"},deleteViewText:{attribute:"delete-view-text",default:"Remove the view"},lastSharedViewText:{attribute:"last-shared-view-text",default:"The only view everyone has"},sharedLayerText:{attribute:"shared-layer-text",default:"Everyone's"},widthText:{attribute:"width-text",default:"Full width"},fieldLabelText:{attribute:"field-label-text",default:"Name"},sectionIconText:{attribute:"section-icon-text",default:"Section glyph"},sectionIcons:{attribute:"section-icons",default:""},variantText:{attribute:"variant-text",default:"Template"},hintText:{attribute:"hint-text",default:"Hint"},hiddenText:{attribute:"hidden-text",default:"Hide"},configureHintText:{attribute:"configure-hint-text",default:"Drag fields between groups and onto a section on the left. Applied at once."},configureHintNarrowText:{attribute:"configure-hint-narrow-text",default:"Drag fields between groups. Applied at once."},fieldSettingsText:{attribute:"field-settings-text",default:"Field settings"},shownText:{attribute:"shown-text",default:"Shown"},showRareText:{attribute:"show-rare-text",default:"Show rare fields"},hideRareText:{attribute:"hide-rare-text",default:"Hide rare fields"},rareText:{attribute:"rare-text",default:"rare"},unplacedTitle:{attribute:"unplaced-title",default:"Not placed"},moveUpText:{attribute:"move-up-text",default:"Move up"},moveDownText:{attribute:"move-down-text",default:"Move down"},addFieldText:{attribute:"add-field-text",default:"Add a field"},inThisGroupText:{attribute:"in-this-group-text",default:"In this area"},renameText:{attribute:"rename-text",default:"Rename"},saveNameText:{attribute:"save-name-text",default:"Save the name"},cancelNameText:{attribute:"cancel-name-text",default:"Leave the name"},removeFieldText:{attribute:"remove-field-text",default:"Remove from this area"},removeGroupText:{attribute:"remove-group-text",default:"Remove this area"},removeSectionText:{attribute:"remove-section-text",default:"Remove this section"},addGroupText:{attribute:"add-group-text",default:"Add an area"},addSectionText:{attribute:"add-section-text",default:"Add a section"},newGroupTitle:{attribute:"new-group-title",default:"New area"},newSectionTitle:{attribute:"new-section-title",default:"New section"},noMatchText:{attribute:"no-match-text",default:"Nothing matches"},unplacedHintText:{attribute:"unplaced-hint-text",default:"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out."},viewConflictText:{attribute:"view-conflict-text",default:"The view changed and was read again"},viewDeniedText:{attribute:"view-denied-text",default:"You may not change this layer"},backLabel:{attribute:"back-label",default:"Back"},collectionLabel:{attribute:"collection-label",default:""},collectionIcon:{attribute:"collection-icon",default:""},favourite:{type:Boolean,default:!1},favouriteLabel:{attribute:"favourite-label",default:"Favourite"},menuLabel:{attribute:"menu-label",default:"More"},inheritedText:{attribute:"inherited-text",default:"by default"}}}constructor(){super(),this.hostPort=null,this.record=null,this.sections=[],this.selectedSection=null,this.renaming=null,this.namingView=!1,this.arrangementEntered=null,this.resetAsked=!1,this.epoch=0,this.groupReads=new Map,this.groupsReading=new Set,this.groupsRefused=new Map,this.groupEpoch=0,this.message="",this.editing=null,this.changed=new Map,this.errors=new Map,this.inputErrors=new Map,this.controlErrors=new Set,this.conflict=null,this.confirmation=null,this.optionPages=new Map,this.optionSearches=new Map,this.optionEpochs=new Map,this.uploads=new Map,this.view=null,this.configuring=!1,this._openedForDrag=!1,this.viewTarget="personal",this.layerDraft=null,this.entryErrors=new Map,this.viewEpoch=0,this.wide=!0,this.wideMedia=null,this.phoneSection=null}get recordId(){return this.getAttribute("record-id")||""}get collection(){return this.getAttribute("collection")||""}get showRare(){return this.getBooleanAttr("show-rare",!1)}get emptyRecordText(){return this.getAttribute("empty-record-text")||(0,d.pageText)(L,"emptyRecordText",this)}get isEmptyRecord(){if(!this.record)return!1;const e=this.sections??[];return!e.length||!e.some(e=>(e.groups??[]).some(e=>"related"===e.kind||(e.fields??[]).length>0))}get emptyText(){return this.getAttribute("empty-text")||(0,d.pageText)(L,"emptyText",this)}get editText(){return this.getAttribute("edit-text")||(0,d.pageText)(L,"editText",this)}get saveText(){return this.getAttribute("save-text")||(0,d.pageText)(L,"saveText",this)}get cancelText(){return this.getAttribute("cancel-text")||(0,d.pageText)(L,"cancelText",this)}get deleteText(){return this.getAttribute("delete-text")||(0,d.pageText)(L,"deleteText",this)}get unplaced(){const e=this.record?.unplaced;return Array.isArray(e)?e:[]}moveFieldToUnplaced(e,t){if(!this.configuring||!this.layerDraft)return!1;let n=null,i=null;for(const t of this.sections){for(const r of t.groups??[]){const t=(r.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){i=r,[n]=r.fields.splice(t,1);break}}if(n)break}if(!n)return!1;const r=this.record.unplaced??(this.record.unplaced=[]),s=Math.max(0,Math.min(Number.isInteger(t)?t:r.length,r.length));return r.splice(s,0,n),this._writeOrder(this.layerDraft.fields,r,{group:null}),i&&this._writeOrder(this.layerDraft.fields,i.fields??[],{group:String(i.key)}),this.requestComponentUpdate("view-move"),this.saveView()}get recordActions(){const e=this.record?.actions;return Array.isArray(e)?e.map(e=>String(e)):[]}async deleteRecord(){if("view"===this.mode||"create"===this.mode||!this.recordActions.includes("record.delete"))return!1;const e=await this._raise("record.delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null});return this.sfEmit("delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null,answer:e?.answer??null}),!!e&&("applied"===e.answer?(this.closePanel("deleted"),!0):"cancelled"===e.reason?(this._setState("ready"),!1):(this.message=e.message||e.reason||this.viewDeniedText,this._setState("ready"),this.requestComponentUpdate("delete-refused"),!1))}get changedText(){return this.getAttribute("changed-text")||(0,d.pageText)(L,"changedText",this)}get errorsText(){return this.getAttribute("errors-text")||(0,d.pageText)(L,"errorsText",this)}get conflictText(){return this.getAttribute("conflict-text")||(0,d.pageText)(L,"conflictText",this)}get sectionsAs(){return this.getEnumAttr("sections-as",["list","tabs"],"list")}get sectionsLabel(){return this.getAttribute("sections-label")||(0,d.pageText)(L,"sectionsLabel",this)}get panel(){return this.getBooleanAttr("panel",!1)&&!this.full}get full(){return this.getBooleanAttr("full",!1)}set full(e){this.toggleAttribute("full",Boolean(e))}get panelOpen(){return this.panel&&!this.hidden&&"false"!==this.getAttribute("open")}syncPanelOpen(){const e=A.indexOf(this);this.panelOpen&&this.isConnected&&e<0?(A.push(this),C()):!this.panelOpen&&e>=0&&(A.splice(e,1),C()),this.requestComponentUpdate("panel-open")}get revision(){return void 0===this.record?.revision||null===this.record?.revision?"":String(this.record.revision)}get section(){return this.selectedSection??""}get panelSize(){return this.getAttribute("panel-size")||"1"}get panelLabel(){return this.getAttribute("panel-label")||""}get panelWidth(){return this.getAttribute("panel-width")||""}get size(){return"1/2"===this.getAttribute("size")?"1/2":"1"}get mode(){const e=this.getAttribute("mode");return b.includes(e)?e:"auto"}get mayEdit(){return"view"!==this.mode&&("create"===this.mode||(!k(this.hostPort?.version,"1.12.0")||this.recordActions.includes("record.edit")))}get openAll(){return"create"===this.mode||"edit"===this.mode&&this.mayEdit}get drawerWidth(){const e=this.panelWidth;if(!e)return null;if(!this.wide)return e;return`min(${"list"===this.sectionsAs&&((this.sections??[]).length>=2||this.configuring)?`calc(${e} + ${T} + var(--sf-space-4))`:e}, calc(100vw - ${this.edgeRoom}))`}get edgeControlWidth(){const e="1/2"===this.size?"1\\/2":"1";return`calc(var(--sf-text-height-${e}) + 2 * var(--sf-ui-${e}--space-y-tightness-default))`}get edgeRoom(){return`calc(${this.edgeControlWidth} + 2 * var(--sf-space-1\\/2))`}get edgeControlCount(){return 1+(this.address?1:0)+(this.canOpenFullPage?1:0)}get closeLabel(){return this.getAttribute("close-label")||(0,d.pageText)(L,"closeLabel",this)}get linkCopiedLabel(){return this.getAttribute("link-copied-label")||(0,d.pageText)(L,"linkCopiedLabel",this)}get copyLinkLabel(){return this.getAttribute("copy-link-label")||(0,d.pageText)(L,"copyLinkLabel",this)}get configureText(){return this.getAttribute("configure-text")||(0,d.pageText)(L,"configureText",this)}get resetViewAskText(){return this.getAttribute("reset-view-ask-text")||(0,d.pageText)(L,"resetViewAskText",this)}get cancelConfiguringText(){return this.getAttribute("cancel-configuring-text")||(0,d.pageText)(L,"cancelConfiguringText",this)}get doneConfiguringText(){return this.getAttribute("done-configuring-text")||(0,d.pageText)(L,"doneConfiguringText",this)}get resetViewText(){return this.getAttribute("reset-view-text")||(0,d.pageText)(L,"resetViewText",this)}get addViewText(){return this.getAttribute("add-view-text")||(0,d.pageText)(L,"addViewText",this)}get newViewText(){return this.getAttribute("new-view-text")||(0,d.pageText)(L,"newViewText",this)}get deleteViewText(){return this.getAttribute("delete-view-text")||(0,d.pageText)(L,"deleteViewText",this)}get lastSharedViewText(){return this.getAttribute("last-shared-view-text")||(0,d.pageText)(L,"lastSharedViewText",this)}get viewProfileLabel(){return this.getAttribute("view-profile-label")||(0,d.pageText)(L,"viewProfileLabel",this)}get personalLayerText(){return this.getAttribute("personal-layer-text")||(0,d.pageText)(L,"personalLayerText",this)}get sharedLayerText(){return this.getAttribute("shared-layer-text")||(0,d.pageText)(L,"sharedLayerText",this)}get widthText(){return this.getAttribute("width-text")||(0,d.pageText)(L,"widthText",this)}get variantText(){return this.getAttribute("variant-text")||(0,d.pageText)(L,"variantText",this)}get hintText(){return this.getAttribute("hint-text")||(0,d.pageText)(L,"hintText",this)}get hiddenText(){return this.getAttribute("hidden-text")||(0,d.pageText)(L,"hiddenText",this)}get configureHintText(){return this.getAttribute("configure-hint-text")||(0,d.pageText)(L,"configureHintText",this)}get configureHintNarrowText(){return this.getAttribute("configure-hint-narrow-text")||(0,d.pageText)(L,"configureHintNarrowText",this)}get fieldSettingsText(){return this.getAttribute("field-settings-text")||(0,d.pageText)(L,"fieldSettingsText",this)}get shownText(){return this.getAttribute("shown-text")||(0,d.pageText)(L,"shownText",this)}get showRareText(){return this.getAttribute("show-rare-text")||(0,d.pageText)(L,"showRareText",this)}get hideRareText(){return this.getAttribute("hide-rare-text")||(0,d.pageText)(L,"hideRareText",this)}get rareText(){return this.getAttribute("rare-text")||(0,d.pageText)(L,"rareText",this)}get unplacedTitle(){return this.getAttribute("unplaced-title")||(0,d.pageText)(L,"unplacedTitle",this)}get moveUpText(){return this.getAttribute("move-up-text")||(0,d.pageText)(L,"moveUpText",this)}get moveDownText(){return this.getAttribute("move-down-text")||(0,d.pageText)(L,"moveDownText",this)}get addFieldText(){return this.getAttribute("add-field-text")||(0,d.pageText)(L,"addFieldText",this)}get renameText(){return this.getAttribute("rename-text")||(0,d.pageText)(L,"renameText",this)}get saveNameText(){return this.getAttribute("save-name-text")||(0,d.pageText)(L,"saveNameText",this)}get cancelNameText(){return this.getAttribute("cancel-name-text")||(0,d.pageText)(L,"cancelNameText",this)}get removeFieldText(){return this.getAttribute("remove-field-text")||(0,d.pageText)(L,"removeFieldText",this)}get removeGroupText(){return this.getAttribute("remove-group-text")||(0,d.pageText)(L,"removeGroupText",this)}get removeSectionText(){return this.getAttribute("remove-section-text")||(0,d.pageText)(L,"removeSectionText",this)}get addGroupText(){return this.getAttribute("add-group-text")||(0,d.pageText)(L,"addGroupText",this)}get addSectionText(){return this.getAttribute("add-section-text")||(0,d.pageText)(L,"addSectionText",this)}get newGroupTitle(){return this.getAttribute("new-group-title")||(0,d.pageText)(L,"newGroupTitle",this)}get newSectionTitle(){return this.getAttribute("new-section-title")||(0,d.pageText)(L,"newSectionTitle",this)}get sectionIconText(){return this.getAttribute("section-icon-text")||(0,d.pageText)(L,"sectionIconText",this)}get fieldLabelText(){return this.getAttribute("field-label-text")||(0,d.pageText)(L,"fieldLabelText",this)}get inThisGroupText(){return this.getAttribute("in-this-group-text")||(0,d.pageText)(L,"inThisGroupText",this)}get noMatchText(){return this.getAttribute("no-match-text")||(0,d.pageText)(L,"noMatchText",this)}get currentGroups(){const e=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return e?.groups??[]}groupAt(e){return this.currentGroups.findIndex(t=>String(t.key)===String(e))}get groupCount(){return this.currentGroups.length}moveGroupBy(e,t){const n=this.groupAt(e);if(n<0)return!1;const i=n+t;if(i<0||i>=this.groupCount)return!1;const r=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return!!r&&this.moveGroup(e,String(r.key),i)}fieldChoices(e){const t=String(e),n=this._addSession?.group===t?this._addSession:this._buildAddSession(t),i=new Set;for(const e of this._locateGroup(t)?.group?.fields??[])i.add(String(e.key));const r=this.addSearch.trim().toLowerCase(),s=[];for(const e of n.order)(!r||e.label.toLowerCase().includes(r)||e.key.toLowerCase().includes(r))&&s.push({...e,selected:i.has(e.key)});return s}_buildAddSession(e){const t=String(e),n=[],i=new Set,r=(e,t)=>{const r=String(e.key);i.has(r)||(i.add(r),n.push({key:r,label:String(e.label??e.key),group:t}))};for(const e of this._locateGroup(t)?.group?.fields??[])r(e,this.inThisGroupText);for(const e of this.unplaced??[])r(e,this.unplacedTitle);for(const e of this.sections??[])for(const n of e.groups??[]){if(String(n.key)===t||"related"===n.kind)continue;const e=String(n.label??n.key);for(const t of n.fields??[])r(t,e)}return{group:t,order:n}}startAddSession(e){return this._addSearch="",this._addSession=this._buildAddSession(e),this.requestComponentUpdate("add-session"),this._addSession}endAddSession(){this._addSession=null,this._addSearch="",this.requestComponentUpdate("add-session")}get addSearch(){return this._addSearch??""}setAddSearch(e){return this._addSearch=String(e??""),this.requestComponentUpdate("add-search"),this._addSearch}toggleFieldInGroup(e,t,n){return n?this.moveField(e,t,Number.MAX_SAFE_INTEGER):this.moveFieldToUnplaced(e)}get unplacedHintText(){return this.getAttribute("unplaced-hint-text")||(0,d.pageText)(L,"unplacedHintText",this)}get viewConflictText(){return this.getAttribute("view-conflict-text")||(0,d.pageText)(L,"viewConflictText",this)}get collectionLabel(){return this.getAttribute("collection-label")||""}get collectionIcon(){return this.getAttribute("collection-icon")||""}get favourite(){return this.hasAttribute("favourite")}get favouriteLabel(){return this.getAttribute("favourite-label")||(0,d.pageText)(L,"favouriteLabel",this)}get menuLabel(){return this.getAttribute("menu-label")||(0,d.pageText)(L,"menuLabel",this)}get inheritedText(){return this.getAttribute("inherited-text")||(0,d.pageText)(L,"inheritedText",this)}toggleFavourite(){const e=!this.favourite;return this.toggleAttribute("favourite",e),this.requestComponentUpdate("favourite"),this.dispatchEvent(new CustomEvent("sf-view-properties-favourite",{bubbles:!0,composed:!0,detail:{record_id:this.recordId||null,collection:this.collection||null,favourite:e}})),!0}get panelMenuItems(){const e=[];return this.canConfigureView&&!this.configuring&&e.push({id:"configure",name:this.configureText,icon:"tune"}),this.hasRare&&e.push({id:"show-rare",name:this.showRare?this.hideRareText:this.showRareText,icon:this.showRare?"unfold_less":"unfold_more"}),e}async openStandardMenu(e,{label:t,entries:n,select:i,align:r="end"}){if(!(e instanceof Element))return null;await(globalThis.SF?.Loader?.ensure?.(["sf-menu-context"]));let s=this._standardMenu;return s?.isConnected||(s=document.createElement("sf-menu-context"),s.setAttribute("popup",""),s.dataset.sfPropertyViewMenu="",s.addEventListener("sf-menu-context-select",e=>this._standardMenuSelect?.(e.detail?.id)),(this.closest("dialog[open]")||document.body).append(s),this._standardMenu=s),s.isOpen&&this._standardMenuAnchor===e?(s.close(),null):(s.setAttribute("aria-label",t??""),s.entries=n,this._standardMenuSelect=i,this._standardMenuAnchor=e,s.openFor(e,{align:r}))}viewProfileEntries(){const e=this.viewProfile;return this.viewProfiles.map(t=>({id:`view-profile:${t.id}`,text:t.label,kind:"radio",checked:t.id===e,icon:t.shared?"group":"person",caption:t.shared?this.sharedLayerText:this.personalLayerText}))}openPanelMenu(e){const t=[],n=this.viewProfiles;if(n.length>1&&!this.configuring){const e=n.find(e=>e.id===this.viewProfile);t.push({id:"view-profile",text:this.viewProfileLabel,icon:"view_sidebar",value:e?.label??"",submenu:this.viewProfileEntries()})}const i=this.panelMenuItems;t.length&&i.length&&t.push({type:"separator"}),t.push(...i.map(e=>({id:e.id,text:e.name,icon:e.icon})));const r=this.hostMenuEntries();return t.length&&r.length&&t.push({type:"separator"}),t.push(...r),t.length?this.openStandardMenu(e,{label:this.menuLabel,entries:t,select:e=>this._chooseStandardEntry(e)}):null}openViewProfileMenu(e){return this.openStandardMenu(e,{label:this.viewProfileLabel,entries:this.viewProfileEntries(),align:"start",select:e=>this._chooseStandardEntry(e)})}hostMenuElements(){const e=this.querySelector("[data-host-menu]")??this.panelContent?.()?.querySelector?.("[data-host-menu]");return e?[...e.children]:[]}hostMenuEntries(){return this.hostMenuElements().map((e,t)=>{const n=e.matches("a[href], button")?e:e.querySelector("a[href], button")??e,i=(e.getAttribute("text")??e.getAttribute("aria-label")??n.textContent??"").trim(),r=n.matches?.("a[href]")?n.getAttribute("href"):null;return{id:`host:${t}`,text:i,icon:e.getAttribute("icon")??e.getAttribute("icon-start")??e.dataset.icon??void 0,href:r||void 0,danger:"error"===e.getAttribute("scheme")||"true"===e.dataset.danger,disabled:e.hasAttribute("disabled")||!0===n.disabled}}).filter(e=>e.text)}_chooseStandardEntry(e){const t=String(e??"");if(t.startsWith("host:")){const e=this.hostMenuElements()[Number(t.slice(5))],n=e?.matches("a[href], button")?e:e?.querySelector("a[href], button")??e;return n?.matches?.("a[href]")||n?.click?.(),!0}return t.startsWith("view-profile:")?this.selectViewProfile(t.slice(13)):this.chooseMenuItem(t)}chooseMenuItem(e){return"configure"===e?this.startConfiguringView():"reset"===e?this.resetView():"show-rare"===e&&this.toggleShowRare()}get backLabel(){return this.getAttribute("back-label")||(0,d.pageText)(L,"backLabel",this)}get viewDeniedText(){return this.getAttribute("view-denied-text")||(0,d.pageText)(L,"viewDeniedText",this)}get openFullLabel(){return this.getAttribute("open-full-label")||(0,d.pageText)(L,"openFullLabel",this)}get address(){return this.record?.address??null}get canOpenFullPage(){return Boolean(this.address)&&Boolean(this.hostPort?.capabilities?.includes?.("record-open"))}static get observedAttributes(){return[...super.observedAttributes??[],"record-id","hidden","open","full"]}attributeChangedCallback(e,t,n){super.attributeChangedCallback?.(e,t,n),t!==n&&this.isConnected&&("record-id"===e&&this.hostPort&&this.load("record-id-changed"),"hidden"!==e&&"open"!==e&&"full"!==e||this.syncPanelOpen())}onConnected(){super.onConnected?.(),this.hasAttribute("data-state")||this.record||(this.setAttribute("data-state","loading"),this.setAttribute("aria-busy","true")),this.panelOpen&&!A.includes(this)&&(A.push(this),C()),this._onKeyDown=e=>{"Escape"===e.key&&this.panel&&(document.documentElement.dataset.sfPopoverOpen||F()===this&&(e.stopPropagation(),this.closePanel("escape")))},document.addEventListener("keydown",this._onKeyDown,!0),this._onSortableIntent=e=>{if(!this.configuring)return;const t=e.detail??{},[n,i]=String(t.to??"").split(":");i&&("section"===n?this.moveSection(t.item,t.index):"field"===n?this.moveField(t.item,i,t.index):"group"===n?this.moveGroup(t.item,i,t.index):"unplaced"===n&&this.moveFieldToUnplaced(t.item,t.index))},this.addEventListener("sf-sortable-intent",this._onSortableIntent),this._onDocumentSortableIntent=e=>{if(!this.panel||!this.configuring)return;const t=e.target?.closest?.(".sf-property-view-panel");t&&t.getAttribute("data-record-id")===String(this.recordId)&&this._onSortableIntent(e)},document.addEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState=e=>{if(!this.configuring)return;const t=e.detail?.state,n=globalThis.document?.querySelector?.(`.sf-property-view-panel[data-record-id="${this.recordId}"]`),i=n?.querySelector?.('[data-action="toggle-unplaced"]');if(!i)return;const r="true"===i.getAttribute("aria-expanded");if("picked"===t)return this._openedForDrag=!r,void(r||i.click());"dropped"!==t&&"cancelled"!==t||(this._openedForDrag&&"true"===i.getAttribute("aria-expanded")&&i.click(),this._openedForDrag=!1)},document.addEventListener("sf-sortable-state",this._onSortableState),this.wideMedia="function"==typeof globalThis.matchMedia?globalThis.matchMedia(S):null,this.wide=!this.wideMedia||this.wideMedia.matches,this._onWideChange=e=>{this.wide=e.matches,this.wide&&(this.phoneSection=null),this.requestComponentUpdate("viewport")},this.wideMedia?.addEventListener?.("change",this._onWideChange),this.hostPort&&(this.recordId||"create"===this.mode)?this.load("connected"):this.hostPort||this._requestHostPort()}_requestHostPort(){return!this.hostPort&&!this._portRequested&&(this._portRequested=!0,this.dispatchEvent(new CustomEvent("sf-host-port-request",{bubbles:!0,composed:!0,detail:{component:this,context:{owner:"property-view",record:this.recordId||null,group:null}}})),!0)}onDisconnected(){this._standardMenu?.close?.({restoreFocus:!1}),this._standardMenu?.remove(),this._standardMenu=null,this._portRequested=!1;const e=A.indexOf(this);e>=0&&(A.splice(e,1),C()),this._onKeyDown&&document.removeEventListener("keydown",this._onKeyDown,!0),this._onKeyDown=null,this.configuring=!1,this._bindSectionDropTarget(),this._onSortableIntent&&this.removeEventListener("sf-sortable-intent",this._onSortableIntent),this._onSortableIntent=null,this._onDocumentSortableIntent&&document.removeEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState&&document.removeEventListener("sf-sortable-state",this._onSortableState),this._onDocumentSortableIntent=null,this._onWideChange&&this.wideMedia?.removeEventListener?.("change",this._onWideChange),this._onWideChange=null,this.wideMedia=null,super.onDisconnected?.()}panelContent(){const e=this.querySelector("sf-drawer")??this._panelDrawer??null,t=e?.querySelector?.(".sf-property-view-panel");if(t)return t;const n=this.getAttribute("record-id")||"";return[...document.querySelectorAll(".sf-property-view-panel")].find(e=>e.dataset.recordId===n)??null}setHostPort(e){if(!e||"function"!=typeof e.raise||!y.includes(e.version))throw new TypeError(`sf-view-properties requires a declared property-view host port: ${y.join(", ")}`);return this.hostPort=e,this.isConnected&&(this.recordId||"create"===this.mode)&&this.load("host-connected"),this}visible(e,{conditions:t=!0}={}){const n=t?this.fieldValues():null;return(Array.isArray(e)?e:[]).filter(e=>e&&!0!==e.hidden).filter(e=>this.showRare||!0!==e.rare).filter(e=>!n||!e.when||(0,f.tm)(e,n).visible)}fieldValues(){const e=new Map,t=t=>{if(!t||void 0===t.key||null===t.key)return;const n=String(t.key);e.set(n,this.changed.has(n)?this.changed.get(n):t.value)};for(const e of this.sections??[])for(const n of e?.groups??[])(n?.fields??[]).forEach(t);return this.unplaced.forEach(t),e}conditionedField(e,t=this.fieldValues()){if(!e?.when)return e;const n=(0,f.tm)(e,t);return{...e,required:n.required,readonly:!0===e.readonly||!n.enabled}}_hiddenByCondition(){const e=this.fieldValues(),t=new Set,n=n=>{n?.when&&!(0,f.tm)(n,e).visible&&t.add(String(n.key))};for(const e of this.sections??[])for(const t of e?.groups??[])(t?.fields??[]).forEach(n);return this.unplaced.forEach(n),t}_savedValues(){const e=this._hiddenByCondition();return Object.fromEntries([...this.changed].filter(([t])=>!e.has(t)))}get viewHost(){const e=this.hostPort??null;if(this._viewHost?.host===e)return this._viewHost.view;const t=Object.create(e&&"object"==typeof e?e:null);return Object.assign(t,{formatFieldValue:(t,n)=>{const i=e?.formatFieldValue?.(t,n);if("string"==typeof i)return i;const r=t?.propertyType??t?.property_type??t?.type??t?.dataType;return(0,g.x)(r,n,this)||void 0}}),this._viewHost={host:e,view:t},t}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,hostPort:this.hostPort,viewHost:this.viewHost,size:this.size,mode:this.mode,mayEdit:this.mayEdit,openAll:this.openAll,createText:(0,d.pageText)(L,"createText",this),emptyText:this.emptyText,emptyRecordText:this.emptyRecordText,isEmptyRecord:this.isEmptyRecord,loading:"loading"===this.getAttribute("data-state")&&!this.record,panel:this.panel,panelOpen:this.panelOpen,recordLabel:this.record?.label?String(this.record.label):"",loadFailure:this.record?null:this.loadFailure??null,editText:this.editText,saveText:this.saveText,cancelText:this.cancelText,deleteText:this.deleteText,recordActions:this.recordActions,changedText:this.changedText,errorsText:this.errorsText,sectionsLabel:this.sectionsLabel,sectionsAs:this.sectionsAs,sections:this.sections,selectedSection:this.selectedSection,editing:this.editing,changed:this.changed,errors:this.inputErrors.size?new Map([...this.errors,...this.inputErrors]):this.errors,inputsInvalid:this.inputErrors.size>0,controlErrors:this.controlErrors,canPickRecords:this.canPickRecords,canUploadFiles:this.canUploadFiles,hostSlot:e=>this.getSlotContent(e),hasHostSlot:e=>this.hasSlotContent(e),address:this.address,stackDepth:this.stackDepth,drawerWidth:this.drawerWidth,sectionsWidth:T,isTopPanel:this.isTopPanel,conflict:this.conflict,confirmation:this.confirmation,confirmSaveText:(0,d.pageText)(L,"confirmSaveText",this),keepEditingText:(0,d.pageText)(L,"keepEditingText",this),message:this.message,visible:e=>this.visible(e),conditionedField:e=>this.conditionedField(e),fieldDisabled:e=>this.fieldDisabled(e),canConfigureView:this.canConfigureView,configuring:this.configuring,unplaced:this.unplaced,viewTarget:this.viewTarget,editableLayers:this.editableLayers,viewProfiles:this.viewProfiles,viewProfile:this.viewProfile,canDeleteViewProfile:e=>this.canDeleteViewProfile(e),layerDenied:e=>this.layerDenied(e),canChangeVisibility:e=>this.canChangeVisibility(e),entryError:(e,t)=>this.entryError(e,t),configureText:this.configureText,doneConfiguringText:this.doneConfiguringText,resetViewText:this.resetViewText,resetViewAskText:this.resetViewAskText,cancelConfiguringText:this.cancelConfiguringText,resetAsked:this.resetAsked,personalLayerText:this.personalLayerText,viewProfileLabel:this.viewProfileLabel,addViewText:this.addViewText,newViewText:this.newViewText,deleteViewText:this.deleteViewText,lastSharedViewText:this.lastSharedViewText,sharedLayerText:this.sharedLayerText,widthText:this.widthText,fieldLabelText:this.fieldLabelText,sectionIcons:this.sectionIcons,sectionIconChoices:this.sectionIconChoices,sectionIconText:this.sectionIconText,variantText:this.variantText,hintText:this.hintText,hiddenText:this.hiddenText,configureHintText:this.wide?this.configureHintText:this.configureHintNarrowText,fieldSettingsText:this.fieldSettingsText,shownText:this.shownText,showRareText:this.showRareText,hideRareText:this.hideRareText,rareText:this.rareText,unplacedTitle:this.unplacedTitle,moveUpText:this.moveUpText,moveDownText:this.moveDownText,addFieldText:this.addFieldText,canOpenFullPage:this.canOpenFullPage,groupAt:e=>this.groupAt(e),groupCount:this.groupCount,fieldChoices:e=>this.fieldChoices(e),addSearch:this.addSearch,inThisGroupText:this.inThisGroupText,renameText:this.renameText,saveNameText:this.saveNameText,cancelNameText:this.cancelNameText,removeFieldText:this.removeFieldText,removeGroupText:this.removeGroupText,removeSectionText:this.removeSectionText,addGroupText:this.addGroupText,addSectionText:this.addSectionText,newGroupTitle:this.newGroupTitle,newSectionTitle:this.newSectionTitle,renaming:this.renaming,namingView:this.namingView,noMatchText:this.noMatchText,unplacedHintText:this.unplacedHintText,panelMenuItems:this.panelMenuItems,collectionLabel:this.collectionLabel,collectionIcon:this.collectionIcon,favourite:this.favourite,favouriteLabel:this.favouriteLabel,menuLabel:this.menuLabel,addressUrl:this.addressUrl??this.address,copyFeedbackMs:_,linkCopiedLabel:this.linkCopiedLabel,closeLabel:this.closeLabel,copyLinkLabel:this.copyLinkLabel,openFullLabel:this.openFullLabel,inheritedText:this.inheritedText,wide:this.wide,edgeControlWidth:this.edgeControlWidth,edgeControlCount:this.edgeControlCount,phoneSection:this.phoneSection,phoneSectionLabel:this.phoneSectionLabel,backLabel:this.backLabel})}template(){return(0,h.$)(this.templateContext())}sfAwaitingData(){return"skeleton"===this.getAttribute("data-sf-first-paint")&&!this.panel&&(!this.record&&!this.loadFailure&&"error"!==this.getAttribute("data-state"))}_setState(e,t=""){const n="loading"===e&&"loading"===this.getAttribute("data-state")&&!this.record;this.setAttribute("data-state",e),this.setAttribute("aria-busy","loading"===e?"true":"false"),this.message=t,n||this.requestComponentUpdate("state"),this.dispatchEvent(new CustomEvent("sf-view-properties-state",{bubbles:!0,composed:!0,detail:{state:e,message:t}}))}async _raise(e,t,{stale:n=()=>!1}={}){if(!this.hostPort)return this._setState("error",(0,d.pageText)(L,"statePortNotConnected",this)),{answer:"unavailable",reason:"port-not-connected"};try{const i=await this.hostPort.raise(e,E(t),{});if(!this.isConnected||n())return null;if(!i||!["applied","conflict","refused","unavailable"].includes(i.answer))throw new TypeError("Host answer is not a declared port answer");return"applied"===i.answer&&Array.isArray(i.effects)&&i.effects.length&&globalThis.SF?.Composition?.publishEffects?.(i.effects,{origin:this}),i}catch(e){return!this.isConnected||n()?null:(this._setState("error",(0,d.pageText)(L,"stateLoadFailed",this)),{answer:"unavailable",reason:"host-threw",message:String(e?.message||e)})}}get readsByGroup(){return Boolean(this.hostPort?.capabilities?.includes("group-load"))&&"create"!==this.mode}async load(e="requested"){this._setState("loading",(0,d.pageText)(L,"stateLoading",this)),this.loadFailure=null;const t=++this.epoch,n="create"===this.mode,i=this.readsByGroup;i&&(this.groupEpoch+=1,this.groupReads=new Map,this.groupsReading=new Set);const r=i?await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,group:null,reason:e},{stale:()=>t!==this.epoch}):await this._raise("record.load",{record_id:n?null:this.recordId||null,collection:this.collection||null,reason:e,...n?{mode:"create"}:{}},{stale:()=>t!==this.epoch});if(!r)return null;if("applied"!==r.answer&&!n&&!this.recordId)return r;if("applied"!==r.answer)return this.loadFailure={kind:"refused"===r.answer?"no-access":"error",text:r.message||""},this._setState("error",r.message||(0,d.pageText)(L,"stateUnavailable",this)),this.sfEmit("failed",{reason:String(r.reason??""),message:String(r.message??"")}),r;this.record=i?{...r.record??{},revision:r.revision??r.record?.revision??null}:r.record??null,this.sections=[],this._takeSections(this.record),this.view=r.record?.view??null;const s=this.editableLayers;s.includes(this.viewTarget)||(this.viewTarget=s[0]??"personal"),s.length||(this.configuring=!1),this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this.entryErrors=new Map;const o=this.sections.some(e=>String(e.key)===this.selectedSection),a=i&&void 0!==r.group&&null!==r.group?this.sections.find(e=>(e.groups??[]).some(e=>String(e.key)===String(r.group))):null;return o||(this.selectedSection=a?String(a.key):this.sections.length?String(this.sections[0].key):null),this._setState("ready"),i&&this._readShownGroups("started"),r}_takeSections(e){if(!Array.isArray(e?.sections))return;const t=E(e.sections);if(!this.readsByGroup)return void(this.sections=t);const n=void 0===e.revision||null===e.revision?"":String(e.revision),i=new Map(this.sections.flatMap(e=>(e.groups??[]).map(e=>[String(e.key),e])));for(const e of t){const t=Array.isArray(e.groups)?e.groups:[];t.forEach((e,r)=>{const s=String(e.key);if(!$(e))return void this.groupReads.set(s,n);const o=i.get(s);o&&this.groupReads.has(s)&&(t[r]={...e,fields:o.fields})})}this.sections=t}_shownGroups(){return(this.openAll||this.configuring?this.sections:this.sections.filter(e=>String(e.key)===this.selectedSection)).flatMap(e=>(e.groups??[]).map(t=>({section:String(e.key),group:String(t.key)})))}_readShownGroups(e="started",{force:t=!1}={}){if(!this.readsByGroup||!this.record)return[];const n=this.revision,i=[];for(const{section:r,group:s}of this._shownGroups())this.groupsReading.has(s)||this.groupsRefused.get(s)!==n&&(t||this.groupReads.get(s)!==n)&&i.push(this._readGroup(r,s,e));return i}async _readGroup(e,t,n){const i=this.groupEpoch;this.groupsReading.add(t),this.requestComponentUpdate("group-reading");const r=await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,section:e,group:t,reason:n},{stale:()=>i!==this.groupEpoch});if(i!==this.groupEpoch)return null;if(this.groupsReading.delete(t),!r)return null;if("refused"===r.answer&&"unknown-group"===r.reason){const e=this.revision;return this.groupsRefused.get(t)===e||(this.groupsRefused.set(t,e),await this.load("requested")),r}if("applied"!==r.answer)return this.requestComponentUpdate("group-reading"),r;const s=r.revision??r.record?.revision??this.record?.revision??null;return this.record={...this.record,...r.record??{},revision:s},this._takeSections(this.record),this.requestComponentUpdate("group-read"),r}isGroupReading(e){return this.groupsReading.has(String(e))}async _rereadAfterConflict(e){if(this.readsByGroup)return void 0!==e?.revision&&null!==e.revision&&this.record&&(this.record={...this.record,revision:e.revision}),Promise.all(this._readShownGroups("requested",{force:!0}));const t=this.epoch,n=await this._raise("record.load",{record_id:this.recordId||null,collection:this.collection||null,reason:"requested"},{stale:()=>t!==this.epoch});return n&&"applied"===n.answer&&n.record?(this.record=n.record,this._takeSections(n.record),this.requestComponentUpdate("conflict-reread"),n):n}get canUploadFiles(){return Boolean(this.hostPort?.capabilities?.includes("field-upload"))}getFieldUploads(e){return this.uploads.get(String(e.key??""))??[]}async startFieldUpload(e,t){const n=String(e.key??""),i=Array.isArray(t)?t:[];if(!i.length)return null;this.uploads.set(n,[...this.getFieldUploads(e),...i]),this.requestComponentUpdate("uploads");for(const t of i){const i=await this._raise("field.upload",{record_id:this.recordId||null,collection:this.collection||null,field:n,file:t.file??t},{stale:()=>!this.uploads.has(n)});if(!i)return null;const r=this.getFieldUploads(e);if("applied"===i.answer&&i.file){const s=this.changed.has(n)?this.changed.get(n):e.value,o=Array.isArray(s)?s:s?[s]:[];this.changed.set(n,[...o,i.file]),this.uploads.set(n,r.filter(e=>e!==t)),this.errors.delete(n)}else this.uploads.set(n,r.map(e=>e===t?{...e,state:"error",errorMessage:i.message||i.reason||""}:e)),"refused"===i.answer&&i.reason&&this.errors.set(n,String(i.message||i.reason));this.requestComponentUpdate("uploads")}return this}retryFieldUpload(e,t){const n=String(e.key??""),i=this.getFieldUploads(e),r=i[Number(t)];return r?(this.uploads.set(n,i.filter(e=>e!==r)),this.startFieldUpload(e,[r])):null}async openReference(e,t){if(!t||"object"!=typeof t)return null;const n=await this._raise("record.open",{record_id:this.recordId||null,collection:this.collection||null,field:String(e.key??""),value:t},{stale:()=>!this.isConnected});return this.sfEmit("open",{field:String(e.key??""),value:t,answer:n?.answer??null}),n}get stackDepth(){const e=A.indexOf(this);return e<0?0:e}get isTopPanel(){return F()===this}closePanel(e="close"){this._commitFocusedEntry();const t=this.unsavedFields;return this.sfEmit("close",{reason:e,record_id:this.recordId||null,unsaved_fields:t},{cancelable:!0})?{outcome:"applied"}:{outcome:"refused",reason:"prevented"}}get unsavedFields(){return new Set([...this.changed.keys(),...this.inputErrors.keys()]).size}_commitFocusedEntry(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;if(!e||"function"!=typeof e.blur)return;const t=this.panel?this.panelContent():null;(this.contains(e)||t?.contains(e))&&e.blur()}get addressUrl(){const e=this.address;if(!e)return null;try{return new URL(String(e),globalThis.location?.href).href}catch{return String(e)}}copyControl(){return[...document.querySelectorAll('sf-button-copy[data-action="copy-link"]')].find(e=>e.propertyView===this)??null}get addressCopied(){return"success"===this.copyControl()?.state?.phase}announceAddressCopy(e){const t=this.address;return this.dispatchEvent(new CustomEvent("sf-view-properties-address-copy",{bubbles:!0,composed:!0,detail:{address:t,url:this.addressUrl??t,copied:e,record_id:this.recordId||null}})),e}async copyAddress(){if(!this.address)return null;const e=this.copyControl();return e?.copy?Boolean(await e.copy()):null}openFullPage(){const e=this.address;return e?(this.sfEmit("open-full",{id:this.recordId||null,address:e,record_id:this.recordId||null}),this):null}openPhoneSection(e){const t=String(e);return!!this.sections.some(e=>String(e.key)===t)&&(this.phoneSection=t,this.selectSection(t),this.requestComponentUpdate("phone-section"),!0)}closePhoneSection(){return null!==this.phoneSection&&(this.phoneSection=null,this.requestComponentUpdate("phone-section"),!0)}get phoneSectionLabel(){const e=this.sections.find(e=>String(e.key)===this.phoneSection);return e?String(e.label??e.key):""}selectSection(e){return this.selectedSection=String(e),this.requestComponentUpdate("section"),this._readShownGroups("started"),this}get canPickRecords(){return Boolean(this.hostPort?.capabilities?.includes("field-options"))}getFieldOptionsPage(e){return this.optionPages.get(String(e.key??""))??null}getFieldOptionSearch(e){return this.optionSearches.get(String(e.key??""))??""}setFieldOptionSearch(e,t){return this.optionSearches.set(String(e.key??""),String(t??"")),this}async loadFieldOptions(e,{cursor:t=null,search:n="",quiet:i=!1}={}){const r=String(e.key??""),s=this.optionPages.get(r),o=t&&Array.isArray(s?.items)?s.items:[];this.optionPages.set(r,{items:o,status:"loading",quiet:i,nextCursor:s?.nextCursor??null}),this.requestComponentUpdate("options");const a=this.epoch,l=(this.optionEpochs.get(r)??0)+1;this.optionEpochs.set(r,l);const c=await this._raise("field.options",{record_id:this.recordId||null,collection:this.collection||null,field:r,cursor:t,search:String(n??""),...k(this.hostPort?.version,"1.14.0")?{...e.source?{source:String(e.source)}:{},limit:w}:{}},{stale:()=>a!==this.epoch||l!==this.optionEpochs.get(r)});if(!c)return null;if("applied"!==c.answer){const e="refused"===c.answer;return this.optionPages.set(r,{items:o,status:e?"unsupported":"error",quiet:!1,nextCursor:null}),this.requestComponentUpdate("options"),c}const u=c.options_page??{},d=Array.isArray(u.items)?u.items:[];return this.optionPages.set(r,{items:t?[...o,...d]:d,status:"ready",quiet:!1,nextCursor:u.next_cursor??null,total:u.total??null}),this.requestComponentUpdate("options"),c}changeField(e,t){const n=String(e.key??""),i=Object.hasOwn(e??{},"value")&&void 0!==t&&JSON.stringify(t)===JSON.stringify(e.value??null);return void 0===t||i?this.changed.delete(n):this.changed.set(n,t),this.errors.delete(n),this.confirmation=null,this.requestComponentUpdate("changed"),this}_clearInputs(){this.inputErrors.clear(),this.controlErrors.clear()}reportFieldError(e,t){const n=String(e?.key??"");if(!n)return this;const i=this.inputErrors.get(n);return t?(this.inputErrors.set(n,String(t)),this.controlErrors.add(n)):this.controlErrors.has(n)&&(this.inputErrors.delete(n),this.controlErrors.delete(n)),this.inputErrors.get(n)!==i&&this.requestComponentUpdate("errors"),this}fieldDisabled(e,t=this.fieldValues()){return Boolean(e?.when)&&!(0,f.tm)(e,t).enabled}_inputsInvalid(){return this.inputErrors.size?(this.requestComponentUpdate("errors"),{answer:"refused",reason:"input_invalid",errors:Object.fromEntries(this.inputErrors)}):null}_referenceFields(e,t){const n=this.sections.find(t=>String(t.key)===String(e)),i=this.visible(n?.groups).find(e=>String(e.key)===String(t));return this.visible(i?.fields,{conditions:!1}).filter(e=>x.includes(e.propertyType||e.type)).filter(e=>!("lookup"===(e.propertyType||e.type)&&Array.isArray(e.options)&&e.options.length>0))}editGroup(e,t){if(!this.mayEdit)return this;if(this.editing={section:String(e),group:String(t)},this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this.canPickRecords)for(const n of this._referenceFields(e,t))this.optionPages.has(String(n.key??""))||this.loadFieldOptions(n,{cursor:null,search:"",quiet:!0});return this}cancelEdit(){if(this.openAll)return this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode}})),this.panel?(this.closePanel("cancelled"),this):(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this);const e=this.editing;return this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),e&&this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode,scope:"group",section:e.section,group:e.group}})),this}announceSaved(e){const t=this.recordId||e?.record_id||e?.record?.record_id||null,n=e?.revision??e?.record?.revision??this.record?.revision??null;this.sfEmit("saved",{id:t,revision:null===n?"":String(n)})}async saveGroup({confirm:e=null}={}){if(this.openAll)return this.saveAll({confirm:e});if(this.editing&&this.inputErrors.size)return this._inputsInvalid();if(!this.editing||0===this.changed.size)return null;const t=this._savedValues();if(!Object.keys(t).length)return null;this.confirmation=null;const n=++this.epoch,i=await this._raise("group.save",{record_id:this.recordId||null,collection:this.collection||null,section:this.editing.section,group:this.editing.group,values:t,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>n!==this.epoch});return i?this._askedToConfirm(i)?i:"applied"===i.answer?(this.record=i.record?{...i.record,revision:i.revision??i.record.revision}:{...this.record,revision:i.revision??this.record?.revision??null},this._takeSections(this.record),this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this._setState("ready"),this.announceSaved(i),i):"conflict"===i.answer?(this.conflict=i.message||this.conflictText,this.requestComponentUpdate("conflict"),await this._rereadAfterConflict(i),i):"refused"===i.answer&&"unknown-group"===i.reason?(await this.load("requested"),i):"refused"===i.answer?(this.errors=new Map(Object.entries(i.errors??{}).map(([e,t])=>[e,String(t)])),this.requestComponentUpdate("errors"),i):(this._setState("error",i.message||(0,d.pageText)(L,"saveFailedText",this)),i):null}async saveAll({confirm:e=null}={}){if(this.inputErrors.size)return this._inputsInvalid();if("create"!==this.mode&&0===this.changed.size)return null;const t="create"===this.mode,n=this._savedValues();if(!t&&!Object.keys(n).length)return null;this.confirmation=null;const i=++this.epoch,r=t?await this._raise("record.create",{collection:this.collection||null,values:n},{stale:()=>i!==this.epoch}):await this._raise("record.save",{record_id:this.recordId||null,collection:this.collection||null,values:n,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>i!==this.epoch});if(!r)return null;if(!t&&this._askedToConfirm(r))return r;if("applied"===r.answer){if(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,t){const e=r.record_id??r.record?.record_id??null;return this.dispatchEvent(new CustomEvent("sf-view-properties-created",{bubbles:!0,composed:!0,detail:{record_id:e,collection:this.collection||null}})),null!==e&&(this.setAttribute("record-id",String(e)),this.setAttribute("mode","auto"),r.record?(this.record=r.record,this._takeSections(r.record),this.view=r.record.view??this.view,this._setState("ready")):await this.load("created")),r}return this.record=r.record??this.record,this._takeSections(r.record),this._setState("ready"),this.announceSaved(r),r}return"conflict"===r.answer?(this.conflict=r.message||this.conflictText,this.requestComponentUpdate("conflict"),r):"refused"===r.answer?(this.errors=new Map(Object.entries(r.errors??{}).map(([e,t])=>[e,String(t)])),!this.errors.size&&r.message&&(this.conflict=r.message),this.requestComponentUpdate("errors"),r):(this._setState("error",r.message||(0,d.pageText)(L,"saveFailedText",this)),r)}_askedToConfirm(e){const t=e?.confirm;return!("refused"!==e?.answer||"confirm_required"!==e.reason||!t||"string"!=typeof t.digest||!t.digest)&&(this.confirmation={text:String(t.summary||e.message||""),digest:t.digest},this.requestComponentUpdate("confirmation"),!0)}confirmSave(){const e=this.confirmation?.digest;return e?this.openAll?this.saveAll({confirm:e}):this.saveGroup({confirm:e}):Promise.resolve(null)}cancelConfirmation(){return this.confirmation=null,this.requestComponentUpdate("confirmation"),this}get canConfigureView(){return"view"!==this.mode&&(Boolean(this.hostPort?.capabilities?.includes?.("view-settings"))&&Boolean(this.view)&&this.editableLayers.length>0)}get viewProfiles(){const e=this.view?.profiles;return Array.isArray(e)?e.filter(e=>e&&"string"==typeof e.id&&e.id):[]}get viewProfile(){const e=this.view?.profile;return"string"==typeof e&&e?e:this.viewProfiles[0]?.id??null}canDeleteViewProfile(e){const t=this.viewProfiles,n=t.find(t=>t.id===String(e??""));return!!n&&(!n.shared||t.filter(e=>e.shared).length>1)}createViewProfile(e,{shared:t=!1}={}){const n=String(e??"").trim();return n?(this.namingView&&(this.namingView=!1,this.requestComponentUpdate("view-naming")),this._viewProfileIntent("view.create",{label:n,shared:Boolean(t),view:this.layerDraft??this._layerCopy(this.viewTarget)})):null}startNamingView(){return this.namingView=!0,this.requestComponentUpdate("view-naming"),!0}cancelNamingView(){this.namingView=!1,this.requestComponentUpdate("view-naming")}renameViewProfile(e,t){const n=String(t??"").trim(),i=String(e??"");return n&&i&&this.viewProfiles.some(e=>e.id===i)?this._viewProfileIntent("view.rename",{profile:i,label:n}):null}deleteViewProfile(e){const t=String(e??"");return this.canDeleteViewProfile(t)?this._viewProfileIntent("view.delete",{profile:t}):null}async _viewProfileIntent(e,t){const n=++this.epoch,i=await this._raise(e,{record_id:this.recordId||null,collection:this.collection||null,...t},{stale:()=>n!==this.epoch});return i?"applied"!==i.answer?(this._setState("error",i.message||this.viewDeniedText),i):(this.record=i.record??this.record,this._takeSections(i.record),this.view=i.record?.view??this.view,this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this._setState("ready"),this.requestComponentUpdate("profiles"),i):null}async selectViewProfile(e){const t=String(e??"");if(!t||t===this.viewProfile)return null;if(!this.viewProfiles.some(e=>e.id===t))return null;const n=++this.epoch,i=await this._raise("view.profile",{record_id:this.recordId||null,collection:this.collection||null,profile:t},{stale:()=>n!==this.epoch});return i?"applied"!==i.answer?(this._setState("error",i.message||this.viewDeniedText),i):(this.record=i.record??this.record,this._takeSections(i.record),this.view=i.record?.view??this.view,this.editing=null,this.changed.clear(),this._clearInputs(),this._setState("ready"),this.configuring&&this.setViewTarget(this._layerOfProfile()),this.requestComponentUpdate("profile"),i):null}get editableLayers(){const e=this.view?.editable;return Array.isArray(e)?e.filter(e=>"personal"===e||"shared"===e):[]}layerDenied(e){return this.editableLayers.includes(e)?null:this.view?.denied?.[e]||this.viewDeniedText}_emptyLayer(){return{schema_version:1,sections:{},groups:{},fields:{}}}_layerCopy(e){const t=this.view?.layers?.[e]?.view;return t?E(t):this._emptyLayer()}_layerRevision(e){const t=this.view?.layers?.[e];return t?t.revision??null:null}toggleShowRare(){return this.toggleAttribute("show-rare",!this.showRare),this.requestComponentUpdate("show-rare"),this.showRare}get hasRare(){const e=e=>(e??[]).some(e=>!0===e?.rare);return(this.sections??[]).some(t=>!0===t?.rare||e(t?.groups)||(t?.groups??[]).some(t=>e(t?.fields)))}_layerOfProfile(){const e=this.viewProfiles.find(e=>e.id===this.viewProfile),t=e?.shared?"shared":"personal";return this.editableLayers.includes(t)?t:this.viewTarget}startConfiguringView(){return!!this.canConfigureView&&(this.configuring=!0,this.viewProfiles.length&&(this.viewTarget=this._layerOfProfile()),this.arrangementEntered={kind:this.viewTarget,revision:this._layerRevision(this.viewTarget),view:this._layerCopy(this.viewTarget)},this.resetAsked=!1,this.layerDraft=this._layerCopy(this.viewTarget),this._bindSectionDropTarget(),this.entryErrors=new Map,this.cancelEdit(),this.requestComponentUpdate("configuring"),this._readShownGroups("started"),this._focusAfterRender(['.sf-property-view-configure-bar [data-action="view-profile"]',".sf-property-view-configure-bar"]),!0)}stopConfiguringView(){const e=this.configuring;this.configuring=!1,this._bindSectionDropTarget(),this.layerDraft=null,this.arrangementEntered=null,this.resetAsked=!1,this.entryErrors=new Map,this.requestComponentUpdate("configuring"),e&&this._focusAfterRender('[data-action="menu"]')}_focusAfterRender(e){const t=e=>(e?.matches?.(p.FOCUSABLE)?e:e?.querySelector?.(p.FOCUSABLE))??null;this.whenRendered(()=>requestAnimationFrame(async()=>{const n=this.panelContent?.()??this;let i=null;for(const r of[e].flat()){const e=[...n?.querySelectorAll?.(r)??[]].pop()??null;if(e&&(i=t(e),!i&&e.localName.includes("-")&&(await customElements.whenDefined(e.localName),await(e.whenRendered?.()),await new Promise(e=>requestAnimationFrame(e)),i=t(e)),i))break}if(!i||!i.isConnected)return;const r=document.activeElement;r&&r!==document.body&&n?.contains?.(r)||i.focus({preventScroll:!0})}),{next:!0})}async cancelConfiguringView(){if(!this.configuring)return!1;const e=this.arrangementEntered;if(!e||e.kind!==this.viewTarget)return this.stopConfiguringView(),!0;const t=(e,t)=>JSON.stringify(e)===JSON.stringify(t),n=this._layerCopy(e.kind);if(null!=e.revision&&this._layerRevision(e.kind)===e.revision||t(n,e.view))return t(this.layerDraft,e.view)||await this.load("view-cancel"),this.stopConfiguringView(),!0;this.layerDraft=E(e.view);const i=await this.saveView();return await this.load("view-cancel"),this.stopConfiguringView(),i}askReset(){return!!this.configuring&&(this.resetAsked=!0,this.requestComponentUpdate("reset-ask"),!0)}cancelReset(){return this.resetAsked=!1,this.requestComponentUpdate("reset-ask"),!0}setViewTarget(e){return!(!this.editableLayers.includes(e)||e===this.viewTarget)&&(this.viewTarget=e,this.layerDraft=this._layerCopy(e),this.entryErrors=new Map,this.requestComponentUpdate("view-target"),!0)}canChangeVisibility(e){const t=e?.hiddenBy??null;return!t||"package"!==t&&("shared"!==t||"shared"===this.viewTarget)}entryError(e,t){return this.entryErrors.get(`${e}:${t}`)??null}_groupsOf(e){const t=this.sections.find(t=>String(t.key)===String(e));return Array.isArray(t?.groups)?t.groups:[]}_fieldsOf(e){for(const t of this.sections)for(const n of t.groups??[])if(String(n.key)===String(e))return Array.isArray(n.fields)?n.fields:[];return[]}_locateGroup(e){for(const t of this.sections)for(const n of t.groups??[])if(String(n.key)===String(e))return{section:t,group:n};return null}_writeOrder(e,t,n={}){t.forEach((t,i)=>{const r=String(t.key);e[r]={...e[r]??{},...n,order:i+1}})}moveFieldToSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const n=(this.sections??[]).find(e=>String(e.key)===String(t));if(!n)return!1;const i=(n.groups??[]).find(e=>"related"!==e.kind);return!!i&&this.moveField(e,String(i.key),(i.fields??[]).length)}_bindSectionDropTarget(){if(!this.configuring)return this._releaseSectionTarget?.(),void(this._releaseSectionTarget=null);if(this._releaseSectionTarget)return;const e=globalThis.SF?.Sortable?.registerSortableDropTarget;if("function"!=typeof e)return;const t=(e,t)=>{const n=globalThis.document?.elementFromPoint?.(e,t),i=n?.closest?.("[data-section-tab], .sf-tree-item[data-value]"),r=this.panelContent();return i&&r&&r.contains(i)?i:null};this._releaseSectionTarget=e({resolve:(e,n,i)=>{if(i?.group&&!["field","group"].includes(i.group))return null;const r=t(e,n);if(!r)return null;const s=r.getAttribute("data-section-tab")??r.getAttribute("data-value");if(s===this.selectedSection)return null;return{descriptor:{section:s},rect:(r.matches("[data-section-tab]")?r:r.querySelector(":scope > .sf-tree-item-container")||r).getBoundingClientRect(),label:r.querySelector(":scope > .sf-tree-item-container > .sf-tree-item-name")?.textContent?.trim()||r.textContent?.trim()||s}},drop:(e,t)=>!!t?.section&&("group"===e?.group?this.moveGroup(e?.item,t.section,Number.MAX_SAFE_INTEGER):this.moveFieldToSection(e?.item,t.section))})}moveField(e,t,n){if(!this.configuring||!this.layerDraft)return!1;const i=this._locateGroup(t);if(!i)return!1;let r=null,s=null;for(const t of this.sections){for(const n of t.groups??[]){const t=(n.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){s=n,[r]=n.fields.splice(t,1);break}}if(r)break}let o=!1;if(!r){const t=this.record?.unplaced??[],n=t.findIndex(t=>String(t.key)===String(e));n>=0&&([r]=t.splice(n,1),o=!0)}if(!r)return!1;const a=i.group.fields??(i.group.fields=[]),l=Math.max(0,Math.min(Number.isInteger(n)?n:a.length,a.length));return a.splice(l,0,r),this._writeOrder(this.layerDraft.fields,a,{group:String(t)}),o&&this._writeOrder(this.layerDraft.fields,this.record?.unplaced??[],{group:null}),s&&s!==i.group&&this._writeOrder(this.layerDraft.fields,s.fields??[],{group:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}moveGroup(e,t,n){if(!this.configuring||!this.layerDraft)return!1;const i=this.sections.find(e=>String(e.key)===String(t));if(!i)return!1;let r=null,s=null;for(const t of this.sections){const n=(t.groups??[]).findIndex(t=>String(t.key)===String(e));if(n>=0){s=t,[r]=t.groups.splice(n,1);break}}if(!r)return!1;const o=i.groups??(i.groups=[]),a=Math.max(0,Math.min(Number.isInteger(n)?n:o.length,o.length));return o.splice(a,0,r),this._writeOrder(this.layerDraft.groups,o,{section:String(t)}),s&&s!==i&&this._writeOrder(this.layerDraft.groups,s.groups??[],{section:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}setFieldView(e,t={}){if(!this.configuring||!this.layerDraft)return!1;const n=["width","variant","hint","label"],i=Object.fromEntries(Object.entries(t).filter(([e])=>n.includes(e)));if(!Object.keys(i).length)return!1;const r=String(e);this.layerDraft.fields[r]={...this.layerDraft.fields[r]??{},...i};for(const e of this.sections)for(const t of e.groups??[])for(const e of t.fields??[])String(e.key)===r&&Object.assign(e,i);return this.requestComponentUpdate("view-field"),this.saveView()}get sectionIcons(){return this.getAttribute("section-icons")||""}get sectionIconChoices(){const e=this.sectionIcons;return e?e.split(/[\s,]+/u).filter(Boolean):O}setSectionIcon(e,t){if(!this.configuring||!this.layerDraft)return!1;const n=String(e),i=this.sections.find(e=>String(e.key)===n);if(!i)return!1;const r=String(t??"").trim()||null;return this.layerDraft.sections[n]={...this.layerDraft.sections[n]??{},icon:r},i.icon=r,this.requestComponentUpdate("view-section-icon"),this.saveView()}renameEntry(e,t,n){if(!this.configuring||!this.layerDraft)return!1;const i={section:"sections",group:"groups"}[e];if(!i)return!1;const r=String(n??"").trim();if(!r)return!1;const s=this._findEntry(e,t);if(!s)return!1;const o=String(t);return this.layerDraft[i][o]={...this.layerDraft[i][o]??{},label:r},s.label=r,this.renaming=null,this.requestComponentUpdate("view-rename"),this.saveView()}startRenaming(e,t){return!!this.configuring&&(this.renaming={kind:e,key:String(t)},this.requestComponentUpdate("view-rename"),!0)}cancelRenaming(){this.renaming=null,this.requestComponentUpdate("view-rename")}removeGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this._locateGroup(e);if(!t||!this.canChangeVisibility(t.group))return!1;for(const e of[...t.group.fields??[]])this.moveFieldToUnplaced(String(e.key));const n=String(e);this.layerDraft.groups[n]={...this.layerDraft.groups[n]??{},hidden:!0},t.group.hidden=!0;const i=this.sections.find(e=>(e.groups??[]).includes(t.group));return i&&(i.groups=(i.groups??[]).filter(e=>e!==t.group)),this.requestComponentUpdate("view-remove-group"),this.saveView()}removeSection(e){if(!this.configuring||!this.layerDraft)return!1;const t=String(e),n=this.sections.find(e=>String(e.key)===t);if(!n||!this.canChangeVisibility(n))return!1;if(this.sections.length<2)return!1;const i=this.sections.find(e=>e!==n);for(const e of[...n.groups??[]])this.moveGroup(String(e.key),String(i.key),Number.MAX_SAFE_INTEGER);return this.layerDraft.sections[t]={...this.layerDraft.sections[t]??{},hidden:!0},n.hidden=!0,this.sections=this.sections.filter(e=>e!==n),this.selectedSection===t&&(this.selectedSection=String(i.key)),this.requestComponentUpdate("view-remove-section"),this.saveView()}moveSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const n=String(e),i=this.sections.findIndex(e=>String(e.key)===n);if(i<0)return!1;const r=[...this.sections],[s]=r.splice(i,1),o=Math.max(0,Math.min(Number.isInteger(t)?t:r.length,r.length));return r.splice(o,0,s),!r.every((e,t)=>e===this.sections[t])&&(this.sections=r,this._writeOrder(this.layerDraft.sections,this.sections,{}),this.requestComponentUpdate("view-move-section"),this.saveView())}addGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this.sections.find(t=>String(t.key)===String(e))??this.sections[0];if(!t)return!1;const n=this._newEntryKey("group"),i={key:n,label:this.newGroupTitle,columns:1,fields:[],hidden:!1,rare:!1,editable:!0};return t.groups=[...t.groups??[],i],this._writeOrder(this.layerDraft.groups,t.groups,{section:String(t.key)}),this.layerDraft.groups[n]={...this.layerDraft.groups[n]??{},label:i.label,section:String(t.key),columns:1,hidden:!1},this.renaming={kind:"group",key:n},this.requestComponentUpdate("view-add-group"),this.saveView()}addSection(){if(!this.configuring||!this.layerDraft)return!1;const e=this._newEntryKey("section"),t={key:e,label:this.newSectionTitle,groups:[],hidden:!1,rare:!1};return this.sections=[...this.sections,t],this._writeOrder(this.layerDraft.sections,this.sections,{}),this.layerDraft.sections[e]={...this.layerDraft.sections[e]??{},label:t.label,hidden:!1},this.selectedSection=e,this.renaming={kind:"section",key:e},this.requestComponentUpdate("view-add-section"),this.saveView()}_newEntryKey(e){return`view-${e}-${Date.now().toString(36)}${Math.floor(46655*Math.random()).toString(36).padStart(3,"0")}`}toggleEntryHidden(e,t){if(!this.configuring||!this.layerDraft)return!1;const n={section:"sections",group:"groups",field:"fields"}[e];if(!n)return!1;const i=this._findEntry(e,t);if(!i||!this.canChangeVisibility(i))return!1;const r=!i.hidden,s=String(t);return this.layerDraft[n][s]={...this.layerDraft[n][s]??{},hidden:r},i.hidden=r,this.requestComponentUpdate("view-hidden"),this.saveView()}_findEntry(e,t){const n=String(t);for(const t of this.sections){if("section"===e&&String(t.key)===n)return t;for(const i of t.groups??[]){if("group"===e&&String(i.key)===n)return i;for(const t of i.fields??[])if("field"===e&&String(t.key)===n)return t}}return null}async saveView(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this._viewWriting??Promise.resolve();let t;this._viewWriting=new Promise(e=>{t=e});try{return await e,await this._saveViewNow()}finally{t()}}async _saveViewNow(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this.viewTarget,t=++this.viewEpoch,n=await this._raise("view.save",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)},view:E(this.layerDraft)},{stale:()=>t!==this.viewEpoch});return n?"applied"===n.answer?(this.entryErrors=new Map,this._storeLayer(e,n.revision??null,n.view??this.layerDraft),n.view?await this.load("view-normalised"):(this._setState("ready"),this.requestComponentUpdate("view-saved")),n):"conflict"===n.answer?(this._storeLayer(e,n.revision??null,n.view??null),this.message=n.message||this.viewConflictText,await this.load("view-conflict"),n):"refused"===n.answer?(this.entryErrors=new Map(Object.entries(n.entry_errors??{}).map(([e,t])=>[e,String(t)])),await this.load("view-refused"),n):(this._setState("error",n.message||(0,d.pageText)(L,"viewSaveFailedText",this)),n):null}_storeLayer(e,t,n){this.view&&(this.view.layers={...this.view.layers??{}},this.view.layers[e]={revision:t,view:n?E(n):null},this.layerDraft=this._layerCopy(e))}async resetView(){if(!this.canConfigureView)return null;this.resetAsked=!1,await(this._viewWriting??Promise.resolve());const e=this.viewTarget,t=++this.viewEpoch,n=await this._raise("view.reset",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)}},{stale:()=>t!==this.viewEpoch});return n?"applied"===n.answer||"conflict"===n.answer?("conflict"===n.answer&&(this.message=n.message||this.viewConflictText),this._storeLayer(e,n.revision??null,null),this.entryErrors=new Map,await this.load("view-reset"),n):(this._setState("error",n.message||(0,d.pageText)(L,"viewResetFailedText",this)),n):null}}(0,s.C3)(V,o),(0,s.l6)(V,o),V.define("sf-view-properties"),t()}catch(I){t(I)}})},"844bdc4d24eb"(e,t,n){n.d(t,{tm:()=>o});const i=Object.freeze(["eq","ne","in","not_in","empty","not_empty"]),r=e=>e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;function s(e,t){if(!e||"object"!=typeof e||Array.isArray(e))return null;for(const n of["all","any"]){if(!(n in e))continue;const i=e[n];if(!Array.isArray(i)||!i.length)return null;const r=i.map(e=>s(e,t));return r.includes(null)?null:"all"===n?r.every(Boolean):r.some(Boolean)}if("not"in e){const n=s(e.not,t);return null===n?null:!n}if("string"!=typeof e.field||!i.includes(e.op))return null;const n=(o=t.get(e.field),(Array.isArray(o)?o:[o]).map(r).filter(e=>null!=e&&""!==e).map(e=>String(e)));var o;if("empty"===e.op)return 0===n.length;if("not_empty"===e.op)return n.length>0;if("eq"===e.op||"ne"===e.op){const t=n.includes(String(r(e.value)));return"eq"===e.op?t:!t}if(!Array.isArray(e.value))return null;const a=e.value.map(e=>String(r(e))),l=n.some(e=>a.includes(e));return"in"===e.op?l:!l}function o(e,t){const n=e?.when&&"object"==typeof e.when?e.when:null,i=e=>n&&e in n?s(n[e],t):null,r=i("visible"),o=i("required"),a=i("enabled");return{visible:r??!0,required:o??!0===e?.required,enabled:a??!0}}},f44b979883f0(e,t,n){n.d(t,{Iv:()=>w,LI:()=>f,PD:()=>a,UD:()=>g,WQ:()=>p,dw:()=>m,e4:()=>s,lw:()=>d,nI:()=>o,uM:()=>h,zJ:()=>b});const i=/^([+-]?)(\d*)(?:[.,](\d*))?$/u,r=/[\s   ']/gu;function s(e){if(null==e)return{ok:!0,value:null};if("number"==typeof e)return Number.isSafeInteger(e)?{ok:!0,value:String(e)}:{ok:!1};const t=String(e).replace(r,"");if(""===t)return{ok:!0,value:null};const n=i.exec(t);if(!n)return{ok:!1};const[,s,o,a]=n;if(""===o&&""===(a??""))return{ok:!1};const l=o.replace(/^0+(?=\d)/u,"")||"0",c=a??"",u=/^0*$/u.test(l+c);return{ok:!0,value:`${"-"!==s||u?"":"-"}${l}${c?`.${c}`:""}`}}function o(e){if(e&&"object"==typeof e&&"bigint"==typeof e.units)return e;const t=s(e);if(!t.ok||null===t.value)return null;const n=t.value.startsWith("-"),[i,r=""]=t.value.replace("-","").split(".");return{units:BigInt(i+r)*(n?-1n:1n),scale:r.length}}function a(e){const t=s(e);if(!t.ok||null===t.value)return 0;const n=t.value.indexOf(".");return-1===n?0:t.value.length-n-1}const l=new Map,c=e=>(l.has(e)||l.set(e,10n**BigInt(e)),l.get(e));function u(e,t){return e.scale===t?e:{units:e.units*c(t-e.scale),scale:t}}function d(e,t){return{units:e.units*t.units,scale:e.scale+t.scale}}function p(e,t){const n=Math.max(e.scale,t.scale);return{units:u(e,n).units+u(t,n).units,scale:n}}function h(e){return{units:e.units,scale:e.scale+2}}function f(e,t){if(e.scale<=t)return u(e,t);const n=c(e.scale-t),i=e.units<0n,r=i?-e.units:e.units;let s=r/n;return r%n*2n>=n&&(s+=1n),{units:i?-s:s,scale:t}}function g(e,t){const n=Math.max(e.scale,t.scale),i=u(e,n).units,r=u(t,n).units;return i===r?0:i<r?-1:1}function m(e){const t=e.units<0n,n=(t?-e.units:e.units).toString().padStart(e.scale+1,"0"),i=e.scale?n.slice(0,-e.scale):n,r=e.scale?n.slice(-e.scale):"",s=0n===e.units;return`${t&&!s?"-":""}${i}${r?`.${r}`:""}`}const v=new Map;function y(e){if(!v.has(e)){let t=" ",n=".";try{for(const i of new Intl.NumberFormat(e).formatToParts(12345.6))"group"===i.type&&(t=i.value),"decimal"===i.type&&(n=i.value)}catch{}v.set(e,{group:t,point:n})}return v.get(e)}function b(e,t,{minFraction:n=0}={}){const i=o(e);if(!i)return"";const r=m(i.scale<n?u(i,n):i),s=r.startsWith("-"),[a,l]=r.replace("-","").split("."),{group:c,point:d}=y(t);return`${s?"−":""}${a.replace(/\B(?=(\d{3})+(?!\d))/gu,c)}${l?`${d}${l}`:""}`}function w(e,t){const n=s(e);return n.ok&&null!==n.value?n.value.replace(".",y(t).point):""}},"62c5c417c97d"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{G:()=>l});var r=n("2a080a730149"),s=n("e5483002f3ea"),o=n("db94c32f22be"),a=e([r,s,o]);[r,s,o]=a.then?(await a)():a;function l(e,t,n,{disabled:i=!1}={}){const a=String(t.key??""),l={setFieldValue:(t,n)=>e.component.changeField(t,n),setFieldError:(t,n)=>e.component.reportFieldError(t,n),...e.canUploadFiles?{getFieldUploads:t=>e.component.getFieldUploads(t),startFieldUpload:(t,n)=>e.component.startFieldUpload(t,n),retryFieldUpload:(t,n)=>e.component.retryFieldUpload(t,n)}:{},...e.canPickRecords?{getFieldOptionsPage:t=>e.component.getFieldOptionsPage(t),getFieldOptionSearch:t=>e.component.getFieldOptionSearch(t),setFieldOptionSearch:(t,n)=>e.component.setFieldOptionSearch(t,n),loadFieldOptions:(t,n)=>e.component.loadFieldOptions(t,n)}:{}},c=(0,o.BE)(t,e.changed.has(a)&&n?e.changed.get(a):t.value,n,l,{node:e.component,size:e.size,viewHost:e.viewHost,disabled:i});if(null!==c)return c===r.nothing?r.html`<span class="sf-property-view-empty color-on-surface-variant">${e.emptyText}</span>`:c;const u=n?(0,s.z4)(t,e.changed.has(a)?e.changed.get(a):t.value,l,{size:e.size,...i?{disabled:!0}:{}}):(0,s.oX)(t,t.value,e.viewHost,{size:e.size}),d=["record","relation","user"].includes(t.propertyType||t.type)&&t.value&&"object"==typeof t.value;if(!n&&d&&u)return r.html`<span
575
577
  class="sf-property-view-reference"
576
- @click=${i=>{i.preventDefault(),i.stopPropagation(),e.component.openReference(t,t.value)}}
577
- >${l}</span>`;if(i&&(null==l||l===n.nothing)){const i=(0,s.oX)(t,t.value,e.viewHost,{size:e.size});if(null!=i&&i!==n.nothing)return n.html`<span class="sf-property-view-readonly color-on-surface-variant" data-readonly="true">${i}</span>`}return null==l||l===n.nothing?n.html`<span class="sf-property-view-empty color-on-surface-variant">${e.emptyText}</span>`:l}function l(e,t){return e.configuring?t??[]:e.visible(t)}function c(e){if(!e.canConfigureView)return n.nothing;if(!e.configuring)return n.nothing;const t=e.editableLayers??[],i=n.html`
578
+ @click=${n=>{n.preventDefault(),n.stopPropagation(),e.component.openReference(t,t.value)}}
579
+ >${u}</span>`;if(n&&(null==u||u===r.nothing)){const n=(0,s.oX)(t,t.value,e.viewHost,{size:e.size});if(null!=n&&n!==r.nothing)return r.html`<span class="sf-property-view-readonly color-on-surface-variant" data-readonly="true">${n}</span>`}return null==u||u===r.nothing?r.html`<span class="sf-property-view-empty color-on-surface-variant">${e.emptyText}</span>`:u}i()}catch(c){i(c)}})},d69ebe7e288e(e,t,n){n.d(t,{Fr:()=>s,fL:()=>l,up:()=>o,xl:()=>a});var i=n("f44b979883f0");const r=new Map;function s(e,t){const n=`${e}|${t}`;if(!r.has(n)){let i=e,s=!1,o=2;try{const n=new Intl.NumberFormat(t,{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}),r=n.formatToParts(1),a=r.findIndex(e=>"currency"===e.type);i=r[a]?.value??e,s=a<r.findIndex(e=>"integer"===e.type),o=n.resolvedOptions().maximumFractionDigits}catch{}r.set(n,{sign:i,before:s,minor:o})}return r.get(n)}function o(e,t,n){if(!t)return(0,i.zJ)(e,n);const{sign:r,before:o,minor:a}=s(t,n),l=(0,i.zJ)(e,n,{minFraction:a});return l?o?`${r}${l}`:`${l} ${r}`:""}function a(e,t){return e&&"object"==typeof e&&!Array.isArray(e)?{amount:e.amount??null,currency:t||(e.currency??null)}:null==e||""===e?{amount:null,currency:t||null}:{amount:e,currency:t||null}}function l(e,t){const n=(0,i.zJ)(e,t);if(!n)return"";let r=!1;try{r=new Intl.NumberFormat(t,{style:"percent"}).formatToParts(.5).some(e=>"literal"===e.type&&/\s/u.test(e.value))}catch{r=!1}return`${n}${r?" ":""}%`}},"06dfc7b3b9d9"(e,t,n){n.d(t,{r5:()=>a});const i=Object.freeze(["inn","kpp","ogrn","bik","account","corr_account"]),r=e=>[...e].map(Number),s=(e,t)=>t.reduce((t,n,i)=>t+n*e[i],0);function o(e,t){return r(e+t).reduce((e,t,n)=>e+t*[7,1,3][n%3],0)%10==0}function a(e,t=i){const n={},a=e=>t.includes(e),l=t=>String(e?.[t]??""),c=l("inn"),u=l("kpp"),d=l("ogrn"),p=l("bik"),h=l("account"),f=l("corr_account");a("inn")&&(c?/^\d{10}$|^\d{12}$/u.test(c)?function(e){if(!/^\d{10}$|^\d{12}$/u.test(e))return!1;const t=r(e);if(10===e.length)return s(t,[2,4,10,3,5,9,4,6,8])%11%10===t[9];const n=s(t,[7,2,4,10,3,5,9,4,6,8])%11%10,i=s(t,[3,7,2,4,10,3,5,9,4,6,8])%11%10;return n===t[10]&&i===t[11]}(c)||(n.inn="innWrong"):n.inn="innLength":n.inn="innRequired");const g=12===c.length,m=10===c.length;a("kpp")&&u&&(/^\d{4}[\dA-Z]{2}\d{3}$/u.test(u)?g&&(n.kpp="kppPerson"):n.kpp="kppWrong"),a("ogrn")&&d&&(/^\d{13}$|^\d{15}$/u.test(d)?!function(e){if(!/^\d{13}$|^\d{15}$/u.test(e))return!1;const t=BigInt(e.slice(0,-1)),n=13===e.length?11n:13n;return Number(t%n%10n)===Number(e.at(-1))}(d)?n.ogrn="ogrnWrong":m&&13!==d.length?n.ogrn="ogrnOrganization":g&&15!==d.length&&(n.ogrn="ogrnPerson"):n.ogrn="ogrnLength");const v=/^04\d{7}$/u.test(p);return a("bik")&&p&&!v&&(n.bik="bikWrong"),a("account")&&h&&(/^\d{20}$/u.test(h)?v&&!o(p.slice(-3),h)&&(n.account="accountKey"):n.account="accountLength"),a("corr_account")&&f&&(/^\d{20}$/u.test(f)?f.startsWith("301")?v&&!o(`0${p.slice(4,6)}`,f)&&(n.corr_account="accountKey"):n.corr_account="corrStart":n.corr_account="accountLength"),n}n.d(t,["rS",0,i])},ebc72103d8b6(e,t,n){n.d(t,{GZ:()=>d,PL:()=>a,RO:()=>l,SK:()=>u,y4:()=>p});var i=n("f44b979883f0"),r=n("d69ebe7e288e");const s=new Set(["integer","number","percent","money"]);function o(e){const{settings:t,...n}=e??{},i=n.propertyType||n.type;return{...t&&"object"==typeof t?t:{},...n,propertyType:i,type:i}}function a(e){return(Array.isArray(e.columns)?e.columns:[]).map(o).filter(e=>e.key)}function l(e){return Array.isArray(e)?e.map(e=>e&&"object"==typeof e?e:{}):[]}function c(e,t){return null==t||""===t?null:"money"===e.propertyType?(0,i.nI)((0,r.xl)(t,e.currency).amount):(0,i.nI)(t)}function u(e,t){if(e.currency)return e.currency;if(e.compute?.of){const n=t.find(t=>e.compute.of.includes(t.key)&&"money"===t.propertyType);return n?.currency??null}return null}function d(e,t,n="en"){const s={},o={};for(const n of t)n.compute||Object.hasOwn(e,n.key)&&null!==e[n.key]&&""!==e[n.key]&&(s[n.key]=e[n.key]);for(const e of t){if(!e.compute||"multiply"!==e.compute.op||!Array.isArray(e.compute.of))continue;let a=null,l=null;for(const n of e.compute.of){const e=t.find(e=>e.key===n),o=e?c(e,s[n]):null;if(!o){a=null;break}"money"===e.propertyType&&(l=(0,r.xl)(s[n],e.currency).currency);const u="percent"===e.propertyType?(0,i.uM)(o):o;a=a?(0,i.lw)(a,u):u}if(a)if("money"===e.propertyType){const t=e.currency||l,s=t?(0,r.Fr)(t,n).minor:2;o[e.key]={amount:(0,i.dw)((0,i.LI)(a,s)),currency:t}}else{const t="integer"===e.propertyType?0:Number.isInteger(e.scale)?e.scale:2;o[e.key]=(0,i.dw)((0,i.LI)(a,t))}}return{...s,...o}}function p(e,t){const n={};for(const r of t){if("sum"!==r.total||!s.has(r.propertyType))continue;let t={units:0n,scale:0};for(const n of e){const e=c(r,n[r.key]);e&&(t=(0,i.WQ)(t,e))}n[r.key]=t}return n}n.d(t,["mk",0,s])},db94c32f22be(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{BE:()=>Q});var r=n("2a080a730149"),s=n("e5483002f3ea"),o=n("43090d1c8307"),a=n("f44b979883f0"),l=n("d69ebe7e288e"),c=n("ebc72103d8b6"),u=n("06dfc7b3b9d9"),d=e([r,s,o]);[r,s,o]=d.then?(await d)():d;const p={en:{currency:"Currency",notNumber:"Enter a number",fractionMax:"At most {n} digits after the point",fractionNone:"A whole amount, no digits after the point",chooseCurrency:"Choose a currency",range:"From {min} to {max}",atLeast:"At least {min}",atMost:"At most {max}",addRow:"Add a row",removeRow:"Remove the row",rowUp:"Move the row up",rowDown:"Move the row down",row:"Row {n}",total:"Total",cellsWrong:"Some cells are not filled in correctly",rows:"{n} rows",row1:"1 row",inn:"INN",kpp:"KPP",ogrn:"OGRN",bik:"BIK",account:"Account",corr_account:"Correspondent account",innRequired:"The INN is required",innLength:"10 digits for an organisation, 12 for a person",innWrong:"The INN control digits do not match",kppWrong:"Nine characters: four digits, two digits or letters, three digits",kppPerson:"A person's INN has no KPP",ogrnLength:"13 digits (OGRN) or 15 (OGRNIP)",ogrnWrong:"The control digit does not match",ogrnOrganization:"An organisation has a 13-digit OGRN",ogrnPerson:"A person has a 15-digit OGRNIP",bikWrong:"Nine digits starting with 04",accountLength:"20 digits",accountKey:"The account does not match the BIK",corrStart:"A correspondent account starts with 301"},ru:{currency:"Валюта",notNumber:"Введите число",fractionMax:"Не больше {n} знаков после запятой",fractionNone:"Целая сумма, без знаков после запятой",chooseCurrency:"Выберите валюту",range:"От {min} до {max}",atLeast:"Не меньше {min}",atMost:"Не больше {max}",addRow:"Добавить строку",removeRow:"Удалить строку",rowUp:"Поднять строку",rowDown:"Опустить строку",row:"Строка {n}",total:"Итого",cellsWrong:"Не все ячейки заполнены верно",rows:"{n} строк",row1:"1 строка",inn:"ИНН",kpp:"КПП",ogrn:"ОГРН",bik:"БИК",account:"Расчётный счёт",corr_account:"Корр. счёт",innRequired:"ИНН обязателен",innLength:"10 цифр у организации, 12 у физлица",innWrong:"Не сходятся контрольные цифры ИНН",kppWrong:"Девять знаков: четыре цифры, две цифры или буквы, три цифры",kppPerson:"У ИНН физлица нет КПП",ogrnLength:"13 цифр (ОГРН) или 15 (ОГРНИП)",ogrnWrong:"Не сходится контрольная цифра",ogrnOrganization:"У организации ОГРН из 13 цифр",ogrnPerson:"У физлица ОГРНИП из 15 цифр",bikWrong:"Девять цифр, начиная с 04",accountLength:"20 цифр",accountKey:"Счёт не сходится с БИК",corrStart:"Корр. счёт начинается с 301"}},h="sf-view-properties";function f(e,t,n={}){let i=(0,o.pageText)(p,t,e,h);for(const[e,t]of Object.entries(n))i=i.replaceAll(`{${e}}`,String(t));return i}function g(e,t){const n=(0,o.pageLocale)(e);if(1===t)return f(e,"row1");if(n.startsWith("ru")){const e=t%100,n=t%10;if(n>=2&&n<=4&&(e<12||e>14))return`${t} строки`}return f(e,"rows",{n:t})}Object.freeze(["money","percent","items","compound","ru.requisites"]);const m=["RUB","USD","EUR","CNY","KZT","BYN","AED","TRY","GBP","JPY"],v=new WeakMap,y=e=>(v.has(e)||v.set(e,new Map),v.get(e)),b=new WeakMap,w=e=>(b.has(e)||b.set(e,new Set),b.get(e)),x=e=>e?.requestComponentUpdate?.("changed");function $(e,t,n,i){const r=y(e).get(t),s=(0,a.e4)(n);if(!s.ok)return String(n??"");if("string"==typeof r){const e=(0,a.e4)(r);if(e.ok&&e.value===s.value)return r}return(0,a.Iv)(s.value,i)}function k(e,t,{maxFraction:n=null,min:i=null,max:r=null}={}){const s=(0,a.e4)(t);if(!s.ok)return f(e,"notNumber");if(null===s.value)return null;if(null!==n&&(0,a.PD)(s.value)>n)return 0===n?f(e,"fractionNone"):f(e,"fractionMax",{n});const l=(0,a.nI)(s.value),c=(0,a.nI)(i),u=(0,a.nI)(r),d=(0,o.pageLocale)(e);return c&&(0,a.UD)(l,c)<0||u&&(0,a.UD)(l,u)>0?c&&u?f(e,"range",{min:(0,a.zJ)(i,d),max:(0,a.zJ)(r,d)}):c?f(e,"atLeast",{min:(0,a.zJ)(i,d)}):f(e,"atMost",{max:(0,a.zJ)(r,d)}):null}function S(e,{path:t,value:n,size:i,label:s,required:l,textEnd:c,placeholder:u,check:d,write:p}){const h=(0,o.pageLocale)(e),f=$(e,t,n,h),g=d(f),m=g&&w(e).has(t)?g:"",v=n=>{const i=n.target?.value??"";y(e).set(t,i);const r=(0,a.e4)(i);p(r.ok?r.value:i,d(i))};return r.html`
580
+ <sf-input
581
+ class="sf-view-fields-decimal"
582
+ size=${i}
583
+ appearance="bordered"
584
+ inputmode="decimal"
585
+ value=${f}
586
+ text-end=${c||r.nothing}
587
+ placeholder=${u||r.nothing}
588
+ ?required=${Boolean(l)}
589
+ ?invalid=${Boolean(m)}
590
+ error-message=${m||r.nothing}
591
+ aria-label=${s||""}
592
+ data-path=${t}
593
+ @input=${v}
594
+ @change=${v}
595
+ @focusout=${()=>{y(e).delete(t),w(e).add(t),x(e)}}
596
+ ></sf-input>
597
+ `}function T(e){return{min:e.min??"0",max:e.max??"100"}}function _(e,t,n,i){const{min:r,max:s}=T(e);return S(i.node,{path:i.path??String(e.key??""),value:t,size:i.size,label:e.label||e.key,required:e.required,textEnd:"%",placeholder:e.placeholder,check:e=>k(i.node,e,{min:r,max:s}),write:(t,i)=>{n.setFieldValue(e,t),n.setFieldError?.(e,i)}})}function A(e,t,n){const i=(0,l.fL)(t,(0,o.pageLocale)(n.node));return i?r.html`<span class="sf-field-view">${i}</span>`:r.nothing}function F(e,t,n,i){const s=i.node,c=(0,o.pageLocale)(s),u=i.path??String(e.key??""),d="string"==typeof e.currency&&e.currency?e.currency:null,p=(0,l.xl)(t,d),h=`${u}#currency`,g=p.currency||y(s).get(h)||null,v=g?(0,l.Fr)(g,c).minor:null,b=(t,i,r=g)=>{n.setFieldValue(e,null===t?null:{amount:t,currency:r}),n.setFieldError?.(e,i)},w=S(s,{path:u,value:p.amount,size:i.size,label:e.label||e.key,required:e.required,textEnd:d?(0,l.Fr)(d,c).sign:"",placeholder:e.placeholder,check:t=>{const n=k(s,t,{maxFraction:v,min:e.min??null,max:e.max??null});return n||(null===(0,a.e4)(t).value||g?null:f(s,"chooseCurrency"))},write:b});if(d)return w;const $=[...new Set([...g?[g]:[],...m])];return r.html`
598
+ <span class="sf-view-fields-money flex gap-1/3 min-w-0">
599
+ ${w}
600
+ <sf-dropdown
601
+ class="sf-view-fields-currency"
602
+ size=${i.size}
603
+ appearance="outlined"
604
+ mode="select"
605
+ search="false"
606
+ value=${g??""}
607
+ placeholder=${f(s,"currency")}
608
+ aria-label=${f(s,"currency")}
609
+ .options=${$.map(e=>({type:"text",size:"1",value:e,text:`${e} ${(0,l.Fr)(e,c).sign===e?"":(0,l.Fr)(e,c).sign}`.trim(),selected:e===g}))}
610
+ @change=${t=>{const n=t.detail?.value||null;y(s).set(h,n);const i=p.amount;if(null!==i&&""!==i){const t=n?(0,l.Fr)(n,c).minor:null,r=k(s,i,{maxFraction:t,min:e.min??null,max:e.max??null})||(n?null:f(s,"chooseCurrency"));b((0,a.e4)(i).ok?(0,a.e4)(i).value:i,r,n)}else x(s)}}
611
+ ></sf-dropdown>
612
+ </span>
613
+ `}function C(e,t,n){const i="string"==typeof e.currency&&e.currency?e.currency:null,{amount:r,currency:s}=(0,l.xl)(t,i);return null===r?"":(0,l.up)(r,s,n)}function z(e,t,n){const i=C(e,t,(0,o.pageLocale)(n.node));return i?r.html`<span class="sf-field-view sf-view-fields-amount">${i}</span>`:r.nothing}function E(e,t,n,i){return S(i.node,{path:i.path??String(e.key??""),value:t,size:i.size,label:e.label||e.key,required:e.required,textEnd:e.unit||"",placeholder:e.placeholder,check:t=>k(i.node,t,{min:e.min??null,max:e.max??null}),write:(t,i)=>{n.setFieldValue(e,t),n.setFieldError?.(e,i)}})}function q(e,t,n){const i=(0,a.zJ)(t,n);return i&&e.unit?`${i} ${e.unit}`:i}function L(e,t,n,i,o){if(null==t||""===t)return null;switch(e.propertyType){case"money":{const{amount:r,currency:s}=(0,l.xl)(t,(0,c.SK)(e,n));return null===r?null:(0,l.up)(r,s,i)}case"percent":return(0,l.fL)(t,i);case"number":return q(e,t,i);default:{const n=(0,s.oX)({...e,value:t},t,o,{size:"1"});return null===n||n===r.nothing?null:n}}}function O(e,t,n,i){if("money"===e.propertyType){const r=(0,c.SK)(e,n);return(0,l.up)((0,a.dw)(t),r,i)}return"percent"===e.propertyType?(0,l.fL)((0,a.dw)(t),i):q(e,(0,a.dw)(t),i)}function P(e){switch(e.propertyType){case"boolean":return"minmax(4rem, auto)";case"integer":return"minmax(5.5rem, 0.6fr)";case"percent":return"minmax(6.5rem, 0.6fr)";case"number":return"minmax(6.5rem, 0.7fr)";case"money":return e.currency?"minmax(9rem, 0.9fr)":"minmax(13rem, 1.2fr)";case"date":return"minmax(9rem, 0.8fr)";case"choice":return"minmax(8rem, 1fr)";default:return"minmax(10rem, 2fr)"}}function V(e,t,n,i){const r=(0,o.pageLocale)(i.node),s=(0,c.y4)(t,n),a=n.find(e=>Object.hasOwn(s,e.key)&&"money"===e.propertyType)??n.find(e=>Object.hasOwn(s,e.key)),l=g(i.node,t.length);return a?`${l}, ${f(i.node,"total").toLowerCase()} ${O(a,s[a.key],n,r)}`:l}function I(e,t,n,i,{editing:a,host:l}){const u=i.node,d=(0,o.pageLocale)(u),p=String(e.key??""),h=Number.isInteger(e.minRows)?e.minRows:0,g=Number.isInteger(e.maxRows)?e.maxRows:1e3,m=a?[...t,...Array.from({length:Math.max(0,h-t.length)},()=>({}))]:t,v=(0,c.y4)(t,n),b=Object.keys(v).length>0,x=`${n.map(P).join(" ")}${a?" auto":""}`,$=D(u,p),k=()=>{const t=[...$.values()].some(Boolean);l.setFieldError?.(e,t?f(u,"cellsWrong"):null)},S=t=>{const i=t.map(e=>(0,c.GZ)(e,n,d));l.setFieldValue(e,i.length?i:null)},T=e=>{for(const e of[...y(u).keys()])e.startsWith(`${p}[`)&&y(u).delete(e);for(const e of[...w(u)])e.startsWith(`${p}[`)&&w(u).delete(e);$.clear(),k(),S(e)},A=(o,l,u)=>{const h=`${p}[${l}].${u.key}`,f=o[u.key];if(!a||u.compute||!0===e.readonly||!0===u.readonly){const e=L(u,u.compute&&a?(0,c.GZ)(o,n,d)[u.key]:f,n,d,i.viewHost);return r.html`<span class="sf-view-items-text ${u.compute?"color-on-surface-variant":""}" data-computed=${u.compute?"true":r.nothing}>${e??r.html`<span class="color-on-surface-variant">—</span>`}</span>`}const g={...u,key:h,label:u.label||u.key,value:f},v={setFieldValue:(e,n)=>((e,n,i)=>{const r=m.map(e=>({...e}));null==i||""===i?delete r[e][n.key]:r[e][n.key]=i,S(r.slice(0,Math.max(t.length,e+1)))})(l,u,n),setFieldError:(e,t)=>{$.set(h,t||null),k()}},y={...i,path:h};switch(u.propertyType){case"money":return F({...g,currency:u.currency},f,v,y);case"percent":return _(g,f,v,y);case"number":return E(g,f,v,y);default:return(0,s.z4)(g,f,v,{size:i.size})??r.html`<span class="sf-view-items-text">${L(u,f,n,d,i.viewHost)??"—"}</span>`}};return r.html`
614
+ <span class="sf-view-items-box">
615
+ <span class="sf-view-items ${a?"sf-view-items--edit":""}" data-items=${p} role="table"
616
+ aria-label=${e.label||p} style=${`--sf-view-items-columns: ${x}`}>
617
+ <span class="sf-view-items-head" role="row">
618
+ ${n.map(e=>r.html`<span class="sf-view-items-heading ${c.mk.has(e.propertyType)?"sf-view-items-numeric":""}" role="columnheader">${e.label||e.key}${a&&e.required&&!e.compute?r.html`<span class="color-error" aria-hidden="true"> *</span>`:r.nothing}</span>`)}
619
+ ${a?r.html`<span class="sf-view-items-heading" role="columnheader"></span>`:r.nothing}
620
+ </span>
621
+ ${m.map((e,i)=>r.html`
622
+ <span class="sf-view-items-row" role="row" data-row=${i} aria-label=${f(u,"row",{n:i+1})}>
623
+ ${n.map(t=>r.html`
624
+ <span class="sf-view-items-cell ${c.mk.has(t.propertyType)?"sf-view-items-numeric":""}" role="cell" data-column=${t.key}>
625
+ <span class="sf-view-items-cell-label color-on-surface-variant" aria-hidden="true">${t.label||t.key}</span>
626
+ ${A(e,i,t)}
627
+ </span>`)}
628
+ ${a?(e=>r.html`
629
+ <span class="sf-view-items-actions flex items-cross-center gap-1/4" role="cell">
630
+ <sf-button-icon size="1/2" appearance="link" scheme="secondary" icon="keyboard_arrow_up"
631
+ data-action="row-up" ?disabled=${0===e||e>=t.length}
632
+ title=${f(u,"rowUp")} aria-label=${f(u,"rowUp")}
633
+ @click=${()=>{const n=t.slice();[n[e-1],n[e]]=[n[e],n[e-1]],T(n)}}></sf-button-icon>
634
+ <sf-button-icon size="1/2" appearance="link" scheme="secondary" icon="keyboard_arrow_down"
635
+ data-action="row-down" ?disabled=${e>=t.length-1}
636
+ title=${f(u,"rowDown")} aria-label=${f(u,"rowDown")}
637
+ @click=${()=>{const n=t.slice();[n[e+1],n[e]]=[n[e],n[e+1]],T(n)}}></sf-button-icon>
638
+ <sf-button-icon size="1/2" appearance="link" scheme="secondary" icon="delete"
639
+ data-action="row-remove" ?disabled=${m.length<=h||e>=t.length}
640
+ title=${f(u,"removeRow")} aria-label=${f(u,"removeRow")}
641
+ @click=${()=>T(t.filter((t,n)=>n!==e))}></sf-button-icon>
642
+ </span>
643
+ `)(i):r.nothing}
644
+ </span>`)}
645
+ ${b&&t.length?r.html`
646
+ <span class="sf-view-items-row sf-view-items-totals" role="row" data-totals="true">
647
+ ${n.map((e,t)=>r.html`
648
+ <span class="sf-view-items-cell ${c.mk.has(e.propertyType)?"sf-view-items-numeric":""} ${Object.hasOwn(v,e.key)?"":"sf-view-items-cell--blank"}" role="cell" data-column=${e.key}>
649
+ ${Object.hasOwn(v,e.key)?r.html`<span class="sf-view-items-cell-label color-on-surface-variant" aria-hidden="true">${f(u,"total")}: ${e.label||e.key}</span><span class="sf-view-items-text sf-view-items-total">${O(e,v[e.key],n,d)}</span>`:0===t?r.html`<span class="sf-view-items-text sf-view-items-total-word">${f(u,"total")}</span>`:r.nothing}
650
+ </span>`)}
651
+ ${a?r.html`<span role="cell"></span>`:r.nothing}
652
+ </span>`:r.nothing}
653
+ ${a?r.html`
654
+ <span class="sf-view-items-foot flex items-cross-center gap-1">
655
+ <sf-button appearance="outline" size=${i.size} icon="add" text=${f(u,"addRow")}
656
+ data-action="row-add" ?disabled=${m.length>=g}
657
+ @click=${()=>T([...m,{}])}></sf-button>
658
+ </span>`:r.nothing}
659
+ </span>
660
+ </span>
661
+ `}const R=new WeakMap;function D(e,t){R.has(e)||R.set(e,new Map);const n=R.get(e);return n.has(t)||n.set(t,new Map),n.get(t)}function M(e,t,n,i){return I(e,(0,c.RO)(t),(0,c.PL)(e),i,{editing:!0,host:n})}function N(e,t,n){const i=(0,c.RO)(t);return i.length?n.summary?r.html`<span class="sf-field-view">${V(0,i,(0,c.PL)(e),n)}</span>`:I(e,i,(0,c.PL)(e),n,{editing:!1,host:null}):r.nothing}const j={inn:12,kpp:9,ogrn:15,bik:9,account:20,corr_account:20};function U(e){const t=Array.isArray(e.parts)?e.parts.map(String):u.rS;return u.rS.filter(e=>t.includes(e))}function B(e){return(Array.isArray(e.parts)?e.parts:[]).map(e=>e&&"object"==typeof e?{...e,propertyType:e.propertyType||e.type}:null).filter(e=>e?.key)}function G(e){return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}function W(e,t){const n={};for(const i of e){const e=t[i];null!=e&&""!==e&&(n[i]=e)}return Object.keys(n).length?n:null}function H(e,t,n,i){const s=i.node,o=String(e.key??""),a=U(e),l=G(t),c=(0,u.r5)(l,a),d=(t,i)=>{const r="kpp"===t?i.replace(/\s/gu,"").toUpperCase():i.replace(/\D/gu,""),o=W(a,{...l,[t]:r}),c=(0,u.r5)(o??{},a),d=null===o&&!0!==e.required;n.setFieldValue(e,o),n.setFieldError?.(e,!d&&Object.keys(c).length?f(s,c[Object.keys(c)[0]]):null)};return r.html`
662
+ <span class="sf-view-fields-compound grid gap-1 w-full min-w-0" data-compound=${o}>
663
+ ${a.map(t=>{const n=`${o}.${t}`,a=w(s).has(n),u=0===Object.keys(l).length&&!0!==e.required,p=a&&!u&&c[t]?f(s,c[t]):"";return r.html`
664
+ <span class="sf-view-fields-part flex flex-col gap-1/4 min-w-0 ${"account"===t||"corr_account"===t?"sf-view-fields-part--wide":""}" data-part=${t}>
665
+ <span class="sf-view-fields-part-label color-on-surface-variant">${f(s,t)}${"inn"===t&&e.required?r.html`<span class="color-error" aria-hidden="true"> *</span>`:r.nothing}</span>
666
+ <sf-input
667
+ size=${i.size}
668
+ appearance="bordered"
669
+ inputmode=${"kpp"===t?"text":"numeric"}
670
+ maxlength=${String(j[t])}
671
+ value=${String(l[t]??"")}
672
+ ?required=${"inn"===t&&!0===e.required}
673
+ ?invalid=${Boolean(p)}
674
+ error-message=${p||r.nothing}
675
+ aria-label=${`${e.label||o}: ${f(s,t)}`}
676
+ @input=${e=>d(t,String(e.target?.value??""))}
677
+ @change=${e=>d(t,String(e.target?.value??""))}
678
+ @focusout=${()=>{w(s).add(n),x(s)}}
679
+ ></sf-input>
680
+ </span>`})}
681
+ </span>
682
+ `}function K(e,t,n){const i=G(t);return U(e).filter(e=>i[e]).map(e=>`${f(n,e)} ${i[e]}`).join(", ")}function J(e,t,n){const i=K(e,t,n.node);return i?r.html`<span class="sf-field-view">${i}</span>`:r.nothing}function Y(e,t,n,i){const o=i.node,a=String(e.key??""),l=B(e),c=l.map(e=>e.key),u=G(t),d=D(o,a);return r.html`
683
+ <span class="sf-view-fields-compound grid gap-1 w-full min-w-0" data-compound=${a}>
684
+ ${l.map(t=>{const o=`${a}.${t.key}`,l={...t,key:o,label:t.label||t.key,readonly:!0===e.readonly||!0===t.readonly},p={setFieldValue:(i,r)=>n.setFieldValue(e,W(c,{...u,[t.key]:r})),setFieldError:(t,i)=>{d.set(o,i||null);const r=[...d.values()].find(Boolean);n.setFieldError?.(e,r??null)}},h={...i,path:o},f=Z[t.propertyType]?.edit(l,u[t.key],p,h)??(0,s.z4)(l,u[t.key],p,{size:i.size});return r.html`
685
+ <span class="sf-view-fields-part flex flex-col gap-1/4 min-w-0 ${"full"===t.width?"sf-view-fields-part--wide":""}" data-part=${t.key}>
686
+ <span class="sf-view-fields-part-label color-on-surface-variant">${l.label}${t.required?r.html`<span class="color-error" aria-hidden="true"> *</span>`:r.nothing}</span>
687
+ ${f??r.nothing}
688
+ </span>`})}
689
+ </span>
690
+ `}function X(e,t,n){const i=G(t),o=B(e).filter(e=>null!==i[e.key]&&void 0!==i[e.key]&&""!==i[e.key]);return o.length?r.html`<span class="sf-field-view sf-view-fields-compound-view">${o.map((e,t)=>{const o=Z[e.propertyType]?.view({...e},i[e.key],n),a=o??(0,s.oX)({...e},i[e.key],n.viewHost,{size:n.size})??String(i[e.key]);return r.html`${t?", ":""}<span class="color-on-surface-variant">${e.label||e.key}</span> ${a}`})}</span>`:r.nothing}const Z={money:{edit:F,view:z},percent:{edit:_,view:A},items:{edit:M,view:N},compound:{edit:Y,view:X},"ru.requisites":{edit:H,view:J}};function Q(e,t,n,i,s){const o=Z[String(e.propertyType||e.type)];if(!o)return null;const a=n?null:s.viewHost?.formatFieldValue?.(e,t);return"string"==typeof a&&""!==a?r.html`<span class="sf-field-view">${a}</span>`:n&&!0!==e.readonly&&!0!==s.disabled&&i?.setFieldValue?o.edit(e,t,i,s):o.view(e,t,s)}i()}catch(ee){i(ee)}})},"40b137e60526"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{$:()=>X});var r=n("2a080a730149"),s=n("e5483002f3ea"),o=n("62c5c417c97d"),a=e([r,s,o]);[r,s,o]=a.then?(await a)():a;function l(e,t){return e.configuring?t??[]:e.visible(t)}function c(e){if(!e.canConfigureView)return r.nothing;if(!e.configuring)return r.nothing;const t=e.editableLayers??[],n=r.html`
578
691
  <sf-profile-picker
579
692
  size=${e.size}
580
693
  data-action="view-profile"
581
694
  label=${e.viewProfileLabel}
582
695
  current=${e.viewProfile??""}
583
- .profiles=${(e.viewProfiles??[]).map(i=>({id:i.id,label:i.label,shared:Boolean(i.shared),editable:t.includes(i.shared?"shared":"personal")&&(!i.shared||e.canDeleteViewProfile(i.id))}))}
696
+ .profiles=${(e.viewProfiles??[]).map(n=>({id:n.id,label:n.label,shared:Boolean(n.shared),editable:t.includes(n.shared?"shared":"personal")&&(!n.shared||e.canDeleteViewProfile(n.id))}))}
584
697
  .rights=${{create:{personal:t.includes("personal"),shared:t.includes("shared")}}}
585
698
  @sf-profile-picker-select=${t=>e.component.selectViewProfile(t.detail.id)}
586
699
  @sf-profile-picker-create=${t=>e.component.createViewProfile(t.detail.label,{shared:t.detail.shared})}
587
700
  @sf-profile-picker-rename=${t=>e.component.renameViewProfile(t.detail.id,t.detail.label)}
588
701
  @sf-profile-picker-delete=${t=>e.component.deleteViewProfile(t.detail.id)}
589
- ></sf-profile-picker>`;return n.html`
702
+ ></sf-profile-picker>`;return r.html`
590
703
  <div class="sf-property-view-actions sf-property-view-configure-bar flex items-cross-center gap-2 flex-wrap"
591
704
  data-configuring="true" role="group"
592
705
  aria-label=${e.configureText}>
593
- ${i}
706
+ ${n}
594
707
  <span class="grow"></span>
595
- ${e.resetAsked?n.html`
708
+ ${e.resetAsked?r.html`
596
709
  <span class="sf-property-view-reset-ask color-error">${e.resetViewAskText}</span>
597
710
  <sf-button
598
711
  appearance="link"
@@ -608,7 +721,7 @@
608
721
  text=${e.cancelConfiguringText}
609
722
  data-action="reset-view-cancel"
610
723
  @click=${()=>e.component.cancelReset()}
611
- ></sf-button>`:n.html`
724
+ ></sf-button>`:r.html`
612
725
  <!-- Reset, cancel, done: the further a control reaches, the
613
726
  quieter it is drawn. Reset takes the whole layer away
614
727
  and asks first; cancel puts back the arrangement this
@@ -635,9 +748,9 @@
635
748
  @click=${()=>e.component.stopConfiguringView()}
636
749
  ></sf-button>`}
637
750
  </div>
638
- `}function u(e,t,i){const r=Array.isArray(t.variantOptions)?t.variantOptions:[];return n.html`
751
+ `}function u(e,t,n){const i=Array.isArray(t.variantOptions)?t.variantOptions:[];return r.html`
639
752
  <sf-popover placement="bottom-end" width="16rem" label=${e.fieldSettingsText}
640
- data-settings-for=${i}>
753
+ data-settings-for=${n}>
641
754
  <sf-button-icon
642
755
  slot="trigger"
643
756
  size="1/2"
@@ -656,9 +769,9 @@
656
769
  appearance="bordered"
657
770
  data-action="field-label"
658
771
  aria-label=${e.fieldLabelText}
659
- placeholder=${String(t.label??i)}
772
+ placeholder=${String(t.label??n)}
660
773
  value=${String(t.label??"")}
661
- @change=${t=>e.component.setFieldView(i,{label:String(t.target?.value??"").trim()||null})}
774
+ @change=${t=>e.component.setFieldView(n,{label:String(t.target?.value??"").trim()||null})}
662
775
  ></sf-input>
663
776
  </label>
664
777
  <label class="sf-property-view-settings-row sf-property-view-settings-row--stacked flex flex-col gap-1/4">
@@ -670,10 +783,10 @@
670
783
  aria-label=${e.hintText}
671
784
  placeholder=${e.hintText}
672
785
  value=${String(t.hint??"")}
673
- @change=${t=>e.component.setFieldView(i,{hint:t.target?.value??""})}
786
+ @change=${t=>e.component.setFieldView(n,{hint:t.target?.value??""})}
674
787
  ></sf-input>
675
788
  </label>
676
- ${r.length?n.html`
789
+ ${i.length?r.html`
677
790
  <label class="sf-property-view-settings-row flex items-cross-center justify-between gap-1">
678
791
  <span class="sf-property-view-settings-label color-on-surface-variant">${e.variantText}</span>
679
792
  <sf-dropdown
@@ -684,22 +797,22 @@
684
797
  data-action="variant"
685
798
  aria-label=${e.variantText}
686
799
  value=${String(t.variant??"")}
687
- .options=${r.map(e=>({type:"text",text:e.label??e.text??String(e.value??e),value:String(e.value??e),selected:String(t.variant??"")===String(e.value??e)}))}
688
- @change=${t=>e.component.setFieldView(i,{variant:t.detail?.value??null})}
800
+ .options=${i.map(e=>({type:"text",text:e.label??e.text??String(e.value??e),value:String(e.value??e),selected:String(t.variant??"")===String(e.value??e)}))}
801
+ @change=${t=>e.component.setFieldView(n,{variant:t.detail?.value??null})}
689
802
  ></sf-dropdown>
690
- </label>`:n.nothing}
803
+ </label>`:r.nothing}
691
804
  <label class="sf-property-view-settings-row flex items-cross-center justify-between gap-1">
692
805
  <span class="sf-property-view-settings-label color-on-surface-variant">${e.widthText}</span>
693
806
  <sf-switch
694
807
  size="1/2"
695
808
  data-action="width"
696
809
  ?checked=${"full"===t.width}
697
- @change=${t=>e.component.setFieldView(i,{width:t.target?.checked?"full":"half"})}
810
+ @change=${t=>e.component.setFieldView(n,{width:t.target?.checked?"full":"half"})}
698
811
  ></sf-switch>
699
812
  </label>
700
813
  </div>
701
814
  </sf-popover>
702
- `}function d(e,t,i){const r=!e.canChangeVisibility(t);return n.html`
815
+ `}function d(e,t,n){const i=!e.canChangeVisibility(t);return r.html`
703
816
  <div class="sf-property-view-field-actions flex items-cross-center gap-1/4">
704
817
  <sf-button-icon
705
818
  size="1/2"
@@ -707,20 +820,20 @@
707
820
  scheme="secondary"
708
821
  icon=${t.hidden?"visibility_off":"close"}
709
822
  data-action="remove-field"
710
- ?disabled=${r}
711
- title=${r?e.layerDenied("shared")||e.hiddenText:e.removeFieldText}
823
+ ?disabled=${i}
824
+ title=${i?e.layerDenied("shared")||e.hiddenText:e.removeFieldText}
712
825
  aria-label=${e.removeFieldText}
713
- @click=${()=>e.component.moveFieldToUnplaced(i)}
826
+ @click=${()=>e.component.moveFieldToUnplaced(n)}
714
827
  ></sf-button-icon>
715
- ${u(e,t,i)}
828
+ ${u(e,t,n)}
716
829
  </div>
717
- `}function p(e,t,i,r,s){const o=e.renaming?.kind===t&&e.renaming?.key===String(i);if(!e.configuring)return n.html`<h3 class=${s}>${r}</h3>`;if(!o)return n.html`
830
+ `}function p(e,t,n,i,s){const o=e.renaming?.kind===t&&e.renaming?.key===String(n);if(!e.configuring)return r.html`<h3 class=${s}>${i}</h3>`;if(!o)return r.html`
718
831
  <h3 class=${s}>
719
832
  <button type="button" class="sf-property-view-rename-trigger text-start cursor-pointer"
720
833
  data-action="rename"
721
834
  title=${e.renameText}
722
- @click=${()=>e.component.startRenaming(t,i)}
723
- >${r}</button>
835
+ @click=${()=>e.component.startRenaming(t,n)}
836
+ >${i}</button>
724
837
  </h3>
725
838
  <sf-button-icon
726
839
  size="1/2"
@@ -730,10 +843,10 @@
730
843
  data-action="rename"
731
844
  title=${e.renameText}
732
845
  aria-label=${e.renameText}
733
- @click=${()=>e.component.startRenaming(t,i)}
846
+ @click=${()=>e.component.startRenaming(t,n)}
734
847
  ></sf-button-icon>
735
848
  <span class="grow"></span>
736
- `;const a=n=>{const s=n.target?.closest?.(".sf-property-view-rename")?.querySelector("sf-input");e.component.renameEntry(t,i,s?.value??r)};return n.html`
849
+ `;const a=r=>{const s=r.target?.closest?.(".sf-property-view-rename")?.querySelector("sf-input");e.component.renameEntry(t,n,s?.value??i)};return r.html`
737
850
  <span class="sf-property-view-rename flex items-cross-center gap-1/4 grow min-w-0">
738
851
  <sf-input
739
852
  size="1/2"
@@ -742,7 +855,7 @@
742
855
  root-class="flex-auto min-w-0"
743
856
  data-action="rename-input"
744
857
  aria-label=${e.renameText}
745
- value=${r}
858
+ value=${i}
746
859
  @keydown=${t=>{"Enter"===t.key&&a(t),"Escape"===t.key&&e.component.cancelRenaming()}}
747
860
  ></sf-input>
748
861
  <sf-button-icon
@@ -766,54 +879,54 @@
766
879
  @click=${()=>e.component.cancelRenaming()}
767
880
  ></sf-button-icon>
768
881
  </span>
769
- `}const h='a[href], button, input, select, textarea, [role="button"], [role="link"]';function f(e,t,i,r="",s=""){const o=!e.configuring&&Boolean(t.when)&&e.fieldDisabled(t);!e.configuring&&t.when&&(t=e.conditionedField(t));const l=String(t.key??""),c=e.controlErrors?.has(l)?null:e.errors.get(l),u=e.configuring?e.entryError("field",l):null;return n.html`
882
+ `}const h='a[href], button, input, select, textarea, [role="button"], [role="link"]';function f(e,t,n,i="",s=""){const a=!e.configuring&&Boolean(t.when)&&e.fieldDisabled(t);!e.configuring&&t.when&&(t=e.conditionedField(t));const l=String(t.key??""),c=e.controlErrors?.has(l)?null:e.errors.get(l),u=e.configuring?e.entryError("field",l):null;return r.html`
770
883
  <div class="sf-property-view-field flex flex-col gap-1 min-w-0 ${"full"===t.width?"sf-property-view-field--full":""}"
771
884
  data-field=${l}
772
- data-sf-sortable-item=${e.configuring?l:n.nothing}
773
- data-arranging=${e.configuring?"true":n.nothing}
774
- data-hidden=${e.configuring&&t.hidden?"true":n.nothing}>
775
- ${e.configuring?n.html`<i class="sf-icon sf-property-view-grip items-cross-center" data-sf-sortable-handle
776
- aria-hidden="true">drag_indicator</i>`:n.nothing}
885
+ data-sf-sortable-item=${e.configuring?l:r.nothing}
886
+ data-arranging=${e.configuring?"true":r.nothing}
887
+ data-hidden=${e.configuring&&t.hidden?"true":r.nothing}>
888
+ ${e.configuring?r.html`<i class="sf-icon sf-property-view-grip items-cross-center" data-sf-sortable-handle
889
+ aria-hidden="true">drag_indicator</i>`:r.nothing}
777
890
  <div class="sf-property-view-field-label flex items-cross-center gap-1/3 color-on-surface-variant">
778
891
  ${String(t.label??l)}
779
- ${t.required&&i?n.html`<span class="sf-property-view-required color-error" aria-hidden="true">*</span>`:n.nothing}
780
- ${t.hint?n.html`<sf-help-mark class="sf-property-view-hint"
892
+ ${t.required&&n?r.html`<span class="sf-property-view-required color-error" aria-hidden="true">*</span>`:r.nothing}
893
+ ${t.hint?r.html`<sf-help-mark class="sf-property-view-hint"
781
894
  label=${String(t.hint)}
782
- text=${String(t.hint)}></sf-help-mark>`:n.nothing}
783
- ${t.rare?n.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:n.nothing}
784
- ${t.inherited&&!i?n.html`<span class="sf-property-view-inherited color-on-surface-variant">${e.inheritedText}</span>`:n.nothing}
895
+ text=${String(t.hint)}></sf-help-mark>`:r.nothing}
896
+ ${t.rare?r.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:r.nothing}
897
+ ${t.inherited&&!n?r.html`<span class="sf-property-view-inherited color-on-surface-variant">${e.inheritedText}</span>`:r.nothing}
785
898
  </div>
786
- ${i||e.configuring||!0===t.readonly||!e.mayEdit||e.openAll?n.html`<div class="sf-property-view-field-value min-w-0 flex items-cross-center gap-2 flex-wrap">${a(e,t,i,{disabled:o})}</div>`:n.html`
899
+ ${n||e.configuring||!0===t.readonly||!e.mayEdit||e.openAll?r.html`<div class="sf-property-view-field-value min-w-0 flex items-cross-center gap-2 flex-wrap">${(0,o.G)(e,t,n,{disabled:a})}</div>`:r.html`
787
900
  <button
788
901
  type="button"
789
902
  class="sf-property-view-field-value sf-property-view-field-open min-w-0 flex items-cross-center gap-1 text-start cursor-pointer"
790
903
  data-open-group=${s}
791
904
  title=${e.editText}
792
- @click=${t=>{const i=t.composedPath();i.slice(0,Math.max(0,i.indexOf(t.currentTarget))).some(e=>e.matches?.(h))||e.component.editGroup(r,s)}}
905
+ @click=${t=>{const n=t.composedPath();n.slice(0,Math.max(0,n.indexOf(t.currentTarget))).some(e=>e.matches?.(h))||e.component.editGroup(i,s)}}
793
906
  >
794
- ${a(e,t,i)}
907
+ ${(0,o.G)(e,t,n)}
795
908
  <i class="sf-icon sf-icon--size-1/2 sf-property-view-pen" aria-hidden="true">edit</i>
796
909
  </button>`}
797
- ${e.configuring?d(e,t,l):n.nothing}
798
- ${c||u?n.html`<div class="sf-property-view-field-error color-error" role="alert">${c||u}</div>`:n.nothing}
910
+ ${e.configuring?d(e,t,l):r.nothing}
911
+ ${c||u?r.html`<div class="sf-property-view-field-error color-error" role="alert">${c||u}</div>`:r.nothing}
799
912
  </div>
800
- `}function g(e,t,i){return n.html`
913
+ `}function g(e,t,n){return r.html`
801
914
  <sf-view
802
915
  class="sf-property-view-related"
803
916
  chrome=""
804
917
  row-cap=${String(t.rowCap??5)}
805
918
  port-owner="property-view"
806
919
  port-record=${e.recordId||""}
807
- port-group=${i}
808
- aria-label=${String(t.label??i)}
920
+ port-group=${n}
921
+ aria-label=${String(t.label??n)}
809
922
  >
810
923
  <sf-view-table
811
924
  slot="content"
812
925
  toolbar="false"
813
- aria-label=${String(t.label??i)}
926
+ aria-label=${String(t.label??n)}
814
927
  ></sf-view-table>
815
928
  </sf-view>
816
- `}function m(e,t){const i=e.fieldChoices(t).map(e=>({type:"checkbox",size:"1/2",text:e.label,value:e.key,group:e.group,selected:e.selected,checked:e.selected,ariaLabel:e.label})),r=i.filter(e=>e.selected).map(e=>e.value);return n.html`
929
+ `}function m(e,t){const n=e.fieldChoices(t).map(e=>({type:"checkbox",size:"1/2",text:e.label,value:e.key,group:e.group,selected:e.selected,checked:e.selected,ariaLabel:e.label})),i=n.filter(e=>e.selected).map(e=>e.value);return r.html`
817
930
  <sf-dropdown
818
931
  class="sf-property-view-add"
819
932
  size="1/2"
@@ -822,9 +935,9 @@
822
935
  search-placeholder=${e.addFieldText}
823
936
  aria-label=${e.addFieldText}
824
937
  data-add-for=${t}
825
- value=${r.join(",")}
826
- .options=${i}
827
- @change=${i=>{const r=String(i.detail?.value??"");if(!r)return;const n=Array.isArray(i.detail?.values)?i.detail.values.map(String):[];e.component.toggleFieldInGroup(r,t,n.includes(r))}}
938
+ value=${i.join(",")}
939
+ .options=${n}
940
+ @change=${n=>{const i=String(n.detail?.value??"");if(!i)return;const r=Array.isArray(n.detail?.values)?n.detail.values.map(String):[];e.component.toggleFieldInGroup(i,t,r.includes(i))}}
828
941
  >
829
942
  <sf-button-icon
830
943
  slot="trigger"
@@ -837,32 +950,32 @@
837
950
  aria-label=${e.addFieldText}
838
951
  ></sf-button-icon>
839
952
  </sf-dropdown>
840
- `}function v(e,t,i){const r=String(i.key??""),s=e.openAll&&"related"!==i.kind&&!1!==i.editable||e.editing?.group===r&&e.editing?.section===String(t.key??""),o=l(e,i.fields),a=e.configuring,c=a?e.entryError("group",r):null,u=a&&!e.canChangeVisibility(i),d=Array.isArray(i.fields)&&0!==i.fields.length?0:Number.isInteger(i.field_count)&&i.field_count>0?i.field_count:0,h=d>0||Boolean(e.component.isGroupReading?.(r)),v=d>0?n.html`${Array.from({length:d},(e,t)=>n.html`<div class="sf-skeleton sf-skeleton--animation-pulse" aria-hidden="true">
841
- <div class="sf-skeleton-text sf-skeleton-text--size-1 ${G[t%G.length]}"></div></div>`)}`:n.html`${o.map(i=>f(e,i,s,String(t.key??""),r))}`;return n.html`
953
+ `}function v(e,t,n){const i=String(n.key??""),s=e.openAll&&"related"!==n.kind&&!1!==n.editable||e.editing?.group===i&&e.editing?.section===String(t.key??""),o=l(e,n.fields),a=e.configuring,c=a?e.entryError("group",i):null,u=a&&!e.canChangeVisibility(n),d=Array.isArray(n.fields)&&0!==n.fields.length?0:Number.isInteger(n.field_count)&&n.field_count>0?n.field_count:0,h=d>0||Boolean(e.component.isGroupReading?.(i)),v=d>0?r.html`${Array.from({length:d},(e,t)=>r.html`<div class="sf-skeleton sf-skeleton--animation-pulse" aria-hidden="true">
954
+ <div class="sf-skeleton-text sf-skeleton-text--size-1 ${G[t%G.length]}"></div></div>`)}`:r.html`${o.map(n=>f(e,n,s,String(t.key??""),i))}`;return r.html`
842
955
  <section class="sf-property-view-group bg-surface-0 flex flex-col gap-2 ${s?"sf-property-view-group--editing":""}"
843
- data-group=${r}
844
- aria-busy=${h?"true":n.nothing}
845
- data-sf-sortable-item=${a?r:n.nothing}
846
- data-hidden=${a&&i.hidden?"true":n.nothing}
847
- data-columns=${2===i.columns?"2":"1"}>
956
+ data-group=${i}
957
+ aria-busy=${h?"true":r.nothing}
958
+ data-sf-sortable-item=${a?i:r.nothing}
959
+ data-hidden=${a&&n.hidden?"true":r.nothing}
960
+ data-columns=${2===n.columns?"2":"1"}>
848
961
  <header class="sf-property-view-group-header flex items-cross-center justify-between gap-2">
849
- ${a?n.html`<i class="sf-icon sf-property-view-grip items-cross-center" data-sf-sortable-handle
850
- aria-hidden="true">drag_indicator</i>`:n.nothing}
851
- ${p(e,"group",r,String(i.label??r),"sf-property-view-group-title")}
852
- ${i.rare?n.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:n.nothing}
853
- ${a?n.html`
962
+ ${a?r.html`<i class="sf-icon sf-property-view-grip items-cross-center" data-sf-sortable-handle
963
+ aria-hidden="true">drag_indicator</i>`:r.nothing}
964
+ ${p(e,"group",i,String(n.label??i),"sf-property-view-group-title")}
965
+ ${n.rare?r.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:r.nothing}
966
+ ${a?r.html`
854
967
  <span class="flex items-cross-center gap-1/4">
855
- ${m(e,r)}
968
+ ${m(e,i)}
856
969
  <sf-button-icon
857
970
  size="1/2"
858
971
  appearance="link"
859
972
  scheme="secondary"
860
973
  icon="keyboard_arrow_up"
861
974
  data-action="group-up"
862
- ?disabled=${0===e.groupAt(r)}
975
+ ?disabled=${0===e.groupAt(i)}
863
976
  title=${e.moveUpText}
864
977
  aria-label=${e.moveUpText}
865
- @click=${()=>e.component.moveGroupBy(r,-1)}
978
+ @click=${()=>e.component.moveGroupBy(i,-1)}
866
979
  ></sf-button-icon>
867
980
  <sf-button-icon
868
981
  size="1/2"
@@ -870,45 +983,45 @@
870
983
  scheme="secondary"
871
984
  icon="keyboard_arrow_down"
872
985
  data-action="group-down"
873
- ?disabled=${e.groupAt(r)===e.groupCount-1}
986
+ ?disabled=${e.groupAt(i)===e.groupCount-1}
874
987
  title=${e.moveDownText}
875
988
  aria-label=${e.moveDownText}
876
- @click=${()=>e.component.moveGroupBy(r,1)}
989
+ @click=${()=>e.component.moveGroupBy(i,1)}
877
990
  ></sf-button-icon>
878
991
  <sf-button-icon
879
992
  size="1/2"
880
993
  appearance="link"
881
994
  scheme="secondary"
882
- icon=${i.hidden?"visibility_off":"delete"}
995
+ icon=${n.hidden?"visibility_off":"delete"}
883
996
  data-action="remove-group"
884
997
  ?disabled=${u}
885
998
  title=${u?e.layerDenied("shared")||e.hiddenText:e.removeGroupText}
886
999
  aria-label=${e.removeGroupText}
887
- @click=${()=>e.component.removeGroup(r)}
1000
+ @click=${()=>e.component.removeGroup(i)}
888
1001
  ></sf-button-icon>
889
- </span>`:n.nothing}
890
- ${a||s||!e.mayEdit||e.openAll||"related"===i.kind||!1===i.editable?n.nothing:n.html`
1002
+ </span>`:r.nothing}
1003
+ ${a||s||!e.mayEdit||e.openAll||"related"===n.kind||!1===n.editable?r.nothing:r.html`
891
1004
  <sf-button
892
1005
  appearance="link"
893
1006
  size=${e.size}
894
1007
  text=${e.editText}
895
1008
  data-action="edit"
896
- @click=${()=>e.component.editGroup(String(t.key??""),r)}
1009
+ @click=${()=>e.component.editGroup(String(t.key??""),i)}
897
1010
  ></sf-button>`}
898
1011
  </header>
899
- ${c?n.html`<div class="sf-property-view-group-error" role="alert">${c}</div>`:n.nothing}
900
- ${"related"===i.kind?n.html`<div class="sf-property-view-group-related">${g(e,i,r)}</div>`:a?n.html`
1012
+ ${c?r.html`<div class="sf-property-view-group-error" role="alert">${c}</div>`:r.nothing}
1013
+ ${"related"===n.kind?r.html`<div class="sf-property-view-group-related">${g(e,n,i)}</div>`:a?r.html`
901
1014
  <sf-sortable
902
1015
  class="sf-property-view-group-fields min-w-0"
903
1016
  group="field"
904
1017
  accepts="field"
905
- id=${`field:${r}`}
906
- label=${String(i.label??r)}
907
- >${v}</sf-sortable>`:n.html`<div class="sf-property-view-group-fields min-w-0">${v}</div>`}
1018
+ id=${`field:${i}`}
1019
+ label=${String(n.label??i)}
1020
+ >${v}</sf-sortable>`:r.html`<div class="sf-property-view-group-fields min-w-0">${v}</div>`}
908
1021
  </section>
909
- `}function b(e,t){return n.html`
1022
+ `}function y(e,t){return r.html`
910
1023
  <nav class="sf-property-view-phone-sections flex flex-col" aria-label=${e.sectionsLabel}>
911
- ${t.map(t=>n.html`
1024
+ ${t.map(t=>r.html`
912
1025
  <button
913
1026
  type="button"
914
1027
  class="sf-property-view-phone-section flex items-cross-center justify-between gap-1"
@@ -920,7 +1033,7 @@
920
1033
  </button>
921
1034
  `)}
922
1035
  </nav>
923
- `}function y(e){return n.html`
1036
+ `}function b(e){return r.html`
924
1037
  <div class="sf-property-view-phone-head flex items-cross-center gap-2">
925
1038
  <sf-button-icon
926
1039
  size=${e.size}
@@ -932,19 +1045,19 @@
932
1045
  ></sf-button-icon>
933
1046
  <h2 class="sf-property-view-phone-title">${e.phoneSectionLabel}</h2>
934
1047
  </div>
935
- `}function w(e,t){return t.length<2&&!e.configuring?n.nothing:n.html`
1048
+ `}function w(e,t){return t.length<2&&!e.configuring?r.nothing:r.html`
936
1049
  <nav class="sf-property-view-sections self-cross-stretch flex flex-col min-w-0" aria-label=${e.sectionsLabel}>
937
- ${e.configuring?n.html`
1050
+ ${e.configuring?r.html`
938
1051
  ${$(e,t)}
939
- <div class="sf-property-view-additions flex">${j(e)}</div>`:x(e,t)}
1052
+ <div class="sf-property-view-additions flex">${U(e)}</div>`:x(e,t)}
940
1053
  </nav>
941
- `}function x(e,t){const i=t.map(t=>({label:S(e,t),value:String(t.key),selected:String(t.key)===e.selectedSection,openIcon:t.icon?String(t.icon):"",closedIcon:t.icon?String(t.icon):""}));return n.html`
1054
+ `}function x(e,t){const n=t.map(t=>({label:k(e,t),value:String(t.key),selected:String(t.key)===e.selectedSection,openIcon:t.icon?String(t.icon):"",closedIcon:t.icon?String(t.icon):""}));return r.html`
942
1055
  <sf-tree
943
1056
  selection="one"
944
- .items=${i}
945
- @sf-tree-select=${t=>{const i=t.detail?.id;i&&e.component.selectSection(String(i))}}
1057
+ .items=${n}
1058
+ @sf-tree-select=${t=>{const n=t.detail?.id;n&&e.component.selectSection(String(n))}}
946
1059
  ></sf-tree>
947
- `}function $(e,t){return n.html`
1060
+ `}function $(e,t){return r.html`
948
1061
  <sf-sortable
949
1062
  class="sf-property-view-section-tabs flex flex-col"
950
1063
  group="section"
@@ -952,32 +1065,32 @@
952
1065
  id="section:all"
953
1066
  label=${e.sectionsLabel}
954
1067
  >
955
- ${t.map(t=>n.html`
1068
+ ${t.map(t=>r.html`
956
1069
  <button
957
1070
  type="button"
958
1071
  class="sf-property-view-section-tab flex items-cross-center gap-1/3 min-w-0 text-start cursor-pointer"
959
1072
  data-section-tab=${String(t.key)}
960
1073
  data-sf-sortable-item=${String(t.key)}
961
- aria-current=${String(t.key)===e.selectedSection?"true":n.nothing}
1074
+ aria-current=${String(t.key)===e.selectedSection?"true":r.nothing}
962
1075
  @click=${()=>e.component.selectSection(String(t.key))}
963
1076
  >
964
1077
  <i class="sf-icon sf-property-view-section-grip color-on-surface-variant" data-sf-sortable-handle
965
1078
  aria-hidden="true">drag_indicator</i>
966
1079
  <i class="sf-icon" aria-hidden="true">${t.icon?String(t.icon):"folder"}</i>
967
- <span class="sf-property-view-section-tab-label flex-auto min-w-0">${S(e,t)}</span>
1080
+ <span class="sf-property-view-section-tab-label flex-auto min-w-0">${k(e,t)}</span>
968
1081
  </button>
969
1082
  `)}
970
1083
  </sf-sortable>
971
- `}function S(e,t){const i=String(t.label??t.key);return t.rare?`${i} · ${e.rareText}`:i}function T(e,t){return S(e,t).replace(/\|/gu,"│").replace(/::/gu,":∶")}function k(e,t){const i=Math.max(0,t.findIndex(t=>String(t.key)===e.selectedSection));return n.html`
1084
+ `}function k(e,t){const n=String(t.label??t.key);return t.rare?`${n} · ${e.rareText}`:n}function S(e,t){return k(e,t).replace(/\|/gu,"│").replace(/::/gu,":∶")}function T(e,t){const n=Math.max(0,t.findIndex(t=>String(t.key)===e.selectedSection));return r.html`
972
1085
  <sf-tabs
973
1086
  class="sf-property-view-tabs"
974
1087
  size=${e.size}
975
- active-index=${String(i)}
1088
+ active-index=${String(n)}
976
1089
  aria-label=${e.sectionsLabel}
977
- items=${t.map(t=>T(e,t)).join("|")}
978
- @sf-tabs-change=${i=>{const r=t[Number(i.detail?.current)];r&&e.component.selectSection(String(r.key))}}
1090
+ items=${t.map(t=>S(e,t)).join("|")}
1091
+ @sf-tabs-change=${n=>{const i=t[Number(n.detail?.current)];i&&e.component.selectSection(String(i.key))}}
979
1092
  ></sf-tabs>
980
- `}function _(e){return"1/2"!==e.size?"":" --sf-property-view--title-size: var(--sf-heading-5--size); --sf-property-view--title-height: var(--sf-heading-5--height); --sf-property-view--group-size: var(--sf-text-medium--size); --sf-property-view--group-height: var(--sf-text-medium--height); --sf-property-view--label-size: var(--sf-label-medium--size); --sf-property-view--label-height: var(--sf-label-medium--height); --sf-property-view--value-size: var(--sf-text-small--size); --sf-property-view--value-height: var(--sf-text-small--height);"}function A(e){return n.html`
1093
+ `}function _(e){return"1/2"!==e.size?"":" --sf-property-view--title-size: var(--sf-heading-5--size); --sf-property-view--title-height: var(--sf-heading-5--height); --sf-property-view--group-size: var(--sf-text-medium--size); --sf-property-view--group-height: var(--sf-text-medium--height); --sf-property-view--label-size: var(--sf-label-medium--size); --sf-property-view--label-height: var(--sf-label-medium--height); --sf-property-view--value-size: var(--sf-text-small--size); --sf-property-view--value-height: var(--sf-text-small--height);"}function A(e){return r.html`
981
1094
  <div class="sf-property-view-actions flex items-cross-center gap-2 flex-wrap" role="group"
982
1095
  data-confirming="true">
983
1096
  <span class="sf-property-view-confirm-text" role="alert">${e.confirmation.text}</span>
@@ -997,7 +1110,7 @@
997
1110
  @click=${()=>e.component.cancelConfirmation()}
998
1111
  ></sf-button>
999
1112
  </div>
1000
- `}function F(e){if(e.confirmation)return A(e);const t="create"===e.mode;return n.html`
1113
+ `}function F(e){if(e.confirmation)return A(e);const t="create"===e.mode;return r.html`
1001
1114
  <div class="sf-property-view-actions flex items-cross-center gap-2 flex-wrap" role="group">
1002
1115
  <sf-button
1003
1116
  appearance="default"
@@ -1014,12 +1127,12 @@
1014
1127
  data-action="cancel"
1015
1128
  @click=${()=>e.component.cancelEdit()}
1016
1129
  ></sf-button>
1017
- ${e.errors.size?n.html`<span class="sf-property-view-errors color-error">${e.errorsText}: ${e.errors.size}</span>`:n.nothing}
1018
- ${e.conflict?n.html`<span class="sf-property-view-conflict color-error" role="alert">${e.conflict}</span>`:n.nothing}
1130
+ ${e.errors.size?r.html`<span class="sf-property-view-errors color-error">${e.errorsText}: ${e.errors.size}</span>`:r.nothing}
1131
+ ${e.conflict?r.html`<span class="sf-property-view-conflict color-error" role="alert">${e.conflict}</span>`:r.nothing}
1019
1132
  </div>
1020
- `}function C(e,{panel:t=!1}={}){if("view"===e.mode)return n.nothing;if(e.openAll)return F(e);const i="create"!==e.mode&&e.recordActions.includes("record.delete");if(e.configuring)return c(e);if(e.editing&&e.confirmation)return A(e);const r=t&&e.hasHostSlot("footer");return e.editing||i||r?n.html`
1133
+ `}function C(e,{panel:t=!1}={}){if("view"===e.mode)return r.nothing;if(e.openAll)return F(e);const n="create"!==e.mode&&e.recordActions.includes("record.delete");if(e.configuring)return c(e);if(e.editing&&e.confirmation)return A(e);const i=t&&e.hasHostSlot("footer");return e.editing||n||i?r.html`
1021
1134
  <div class="sf-property-view-actions flex items-cross-center gap-2 flex-wrap" role="group">
1022
- ${e.editing?n.html`
1135
+ ${e.editing?r.html`
1023
1136
  <sf-button
1024
1137
  appearance="default"
1025
1138
  size=${e.size}
@@ -1034,12 +1147,12 @@
1034
1147
  text=${e.cancelText}
1035
1148
  data-action="cancel"
1036
1149
  @click=${()=>e.component.cancelEdit()}
1037
- ></sf-button>`:n.nothing}
1038
- ${e.errors.size?n.html`<span class="sf-property-view-errors color-error">${e.errorsText}: ${e.errors.size}</span>`:n.nothing}
1039
- ${e.conflict?n.html`<span class="sf-property-view-conflict color-error" role="alert">${e.conflict}</span>`:n.nothing}
1150
+ ></sf-button>`:r.nothing}
1151
+ ${e.errors.size?r.html`<span class="sf-property-view-errors color-error">${e.errorsText}: ${e.errors.size}</span>`:r.nothing}
1152
+ ${e.conflict?r.html`<span class="sf-property-view-conflict color-error" role="alert">${e.conflict}</span>`:r.nothing}
1040
1153
  <span class="grow"></span>
1041
- ${r?n.html`<div class="sf-property-view-host-footer flex flex-wrap items-cross-center gap-2">${e.hostSlot("footer")}</div>`:n.nothing}
1042
- ${i?n.html`
1154
+ ${i?r.html`<div class="sf-property-view-host-footer flex flex-wrap items-cross-center gap-2">${e.hostSlot("footer")}</div>`:r.nothing}
1155
+ ${n?r.html`
1043
1156
  <sf-button-icon
1044
1157
  appearance="link"
1045
1158
  status="error"
@@ -1049,20 +1162,20 @@
1049
1162
  title=${e.deleteText}
1050
1163
  aria-label=${e.deleteText}
1051
1164
  @click=${()=>e.component.deleteRecord()}
1052
- ></sf-button-icon>`:n.nothing}
1165
+ ></sf-button-icon>`:r.nothing}
1053
1166
  </div>
1054
- `:n.nothing}function z(e,t){const i=String(t.key??"");return n.html`
1167
+ `:r.nothing}function z(e,t){const n=String(t.key??"");return r.html`
1055
1168
  <div class="sf-property-view-field sf-property-view-field--unplaced flex flex-col gap-1 min-w-0"
1056
- data-field=${i}
1057
- data-sf-sortable-item=${i}
1169
+ data-field=${n}
1170
+ data-sf-sortable-item=${n}
1058
1171
  data-arranging="true">
1059
1172
  <i class="sf-icon sf-property-view-grip items-cross-center" data-sf-sortable-handle aria-hidden="true">drag_indicator</i>
1060
1173
  <div class="sf-property-view-field-label flex items-cross-center gap-1/3 color-on-surface-variant">
1061
- ${String(t.label??i)}
1062
- ${t.rare?n.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:n.nothing}
1174
+ ${String(t.label??n)}
1175
+ ${t.rare?r.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:r.nothing}
1063
1176
  </div>
1064
1177
  </div>
1065
- `}function E(e){if(!e.configuring)return n.nothing;const t=e.unplaced;return n.html`
1178
+ `}function E(e){if(!e.configuring)return r.nothing;const t=e.unplaced;return r.html`
1066
1179
  <article
1067
1180
  class="sf-accordion sf-accordion--outline sf-property-view-group--unplaced"
1068
1181
  data-unplaced="true"
@@ -1076,12 +1189,12 @@
1076
1189
  >
1077
1190
  <span class="sf-accordion-title flex items-cross-center gap-1/3">
1078
1191
  ${e.unplacedTitle}
1079
- ${t.length?n.html`<sf-tag
1192
+ ${t.length?r.html`<sf-tag
1080
1193
  kind="default"
1081
1194
  size="1/3"
1082
1195
  appearance="surface"
1083
1196
  text=${String(t.length)}
1084
- ></sf-tag>`:n.nothing}
1197
+ ></sf-tag>`:r.nothing}
1085
1198
  </span>
1086
1199
  <sf-icon icon="chevron_right" size="1/2"></sf-icon>
1087
1200
  </button>
@@ -1096,7 +1209,7 @@
1096
1209
  >${t.map(t=>z(e,t))}</sf-sortable>
1097
1210
  </div>
1098
1211
  </article>
1099
- `}function q(e){const t=e.panelMenuItems,i=e.hasHostSlot("menu")?e.hostSlot("menu"):null,r=!e.configuring&&(e.viewProfiles?.length??0)>1;return t.length||i||r?n.html`
1212
+ `}function q(e){const t=e.panelMenuItems,n=e.hasHostSlot("menu")?e.hostSlot("menu"):null,i=!e.configuring&&(e.viewProfiles?.length??0)>1;return t.length||n||i?r.html`
1100
1213
  <sf-button-icon
1101
1214
  appearance="link"
1102
1215
  scheme="on-surface"
@@ -1108,8 +1221,8 @@
1108
1221
  aria-label=${e.menuLabel}
1109
1222
  @click=${t=>e.component.openPanelMenu(t.currentTarget.querySelector("button")??t.currentTarget)}
1110
1223
  ></sf-button-icon>
1111
- ${i?n.html`<div class="sf-property-view-host-menu" data-host-menu hidden>${i}</div>`:n.nothing}
1112
- `:n.nothing}function V(e){return n.html`
1224
+ ${n?r.html`<div class="sf-property-view-host-menu" data-host-menu hidden>${n}</div>`:r.nothing}
1225
+ `:r.nothing}function L(e){return r.html`
1113
1226
  <header class="sf-property-view-head flex flex-col gap-1">
1114
1227
  <div class="sf-property-view-title-row flex items-cross-center gap-1 min-w-0">
1115
1228
  <h2 class="sf-property-view-title min-w-0 overflow-hidden">${e.panelLabel||e.recordLabel||e.recordId||""}</h2>
@@ -1121,7 +1234,7 @@
1121
1234
  A record being created is not one yet and cannot be a
1122
1235
  favourite: no star until it has an id (Larena storage
1123
1236
  review, 2026-10-28). -->
1124
- ${e.recordId&&"create"!==e.mode?n.html`<sf-button-icon
1237
+ ${e.recordId&&"create"!==e.mode?r.html`<sf-button-icon
1125
1238
  appearance="link"
1126
1239
  size=${e.size}
1127
1240
  icon="star"
@@ -1130,19 +1243,19 @@
1130
1243
  aria-pressed=${e.favourite?"true":"false"}
1131
1244
  aria-label=${e.favouriteLabel}
1132
1245
  @click=${()=>e.component.toggleFavourite()}
1133
- ></sf-button-icon>`:n.nothing}
1246
+ ></sf-button-icon>`:r.nothing}
1134
1247
  <span class="grow"></span>
1135
- ${e.hasHostSlot("actions")?e.hostSlot("actions"):n.nothing}
1248
+ ${e.hasHostSlot("actions")?e.hostSlot("actions"):r.nothing}
1136
1249
  ${q(e)}
1137
1250
  </div>
1138
1251
  </header>
1139
- `}const L="--sf-icon-button--background-color: var(--sf-elevation-3--surface); --sf-on-surface-variant: var(--sf-on-elevation-3--variant); box-shadow: var(--sf-elevation-3--shadow)";function P(e){return!e.wide||"full"===e.panelSize}function O(e){return n.html`
1252
+ `}const O="--sf-icon-button--background-color: var(--sf-elevation-3--surface); --sf-on-surface-variant: var(--sf-on-elevation-3--variant); box-shadow: var(--sf-elevation-3--shadow)";function P(e){return!e.wide||"full"===e.panelSize}function V(e){return r.html`
1140
1253
  <div class="sf-property-view-edge flex ${P(e)?"flex-row":"flex-col"} gap-1/2" slot="edge"
1141
1254
  aria-label=${e.closeLabel}>
1142
1255
  <sf-button-icon
1143
1256
  appearance="tonal"
1144
1257
  scheme="on-surface"
1145
- root-style=${L}
1258
+ root-style=${O}
1146
1259
  size=${e.size}
1147
1260
  icon="close"
1148
1261
  data-action="close"
@@ -1150,10 +1263,10 @@
1150
1263
  title=${e.closeLabel}
1151
1264
  @click=${()=>e.component.closePanel("close")}
1152
1265
  ></sf-button-icon>
1153
- ${e.address?n.html`
1266
+ ${e.address?r.html`
1154
1267
  <sf-button-copy
1155
1268
  appearance="tonal"
1156
- root-style=${L}
1269
+ root-style=${O}
1157
1270
  size=${e.size}
1158
1271
  icon="link"
1159
1272
  value=${e.addressUrl}
@@ -1164,24 +1277,24 @@
1164
1277
  .propertyView=${e.component}
1165
1278
  @sf-copy-button-copied=${()=>e.component.announceAddressCopy(!0)}
1166
1279
  @sf-copy-button-copy-failed=${()=>e.component.announceAddressCopy(!1)}
1167
- ></sf-button-copy>`:n.nothing}
1168
- ${e.canOpenFullPage?n.html`
1280
+ ></sf-button-copy>`:r.nothing}
1281
+ ${e.canOpenFullPage?r.html`
1169
1282
  <sf-button-icon
1170
1283
  appearance="tonal"
1171
1284
  scheme="on-surface"
1172
- root-style=${L}
1285
+ root-style=${O}
1173
1286
  size=${e.size}
1174
1287
  icon="open_in_full"
1175
1288
  aria-label=${e.openFullLabel}
1176
1289
  title=${e.openFullLabel}
1177
1290
  data-action="open-full"
1178
1291
  @click=${()=>e.component.openFullPage()}
1179
- ></sf-button-icon>`:n.nothing}
1292
+ ></sf-button-icon>`:r.nothing}
1180
1293
  </div>
1181
- `}function D(e,t){return!e.wide&&t.length>1&&null===e.phoneSection}function I(e,t,i){return t?n.html`
1294
+ `}function I(e,t){return!e.wide&&t.length>1&&null===e.phoneSection}function R(e,t,n){return t?r.html`
1182
1295
  <div class="sf-property-view-section-bar flex items-cross-center gap-1/4"
1183
1296
  data-section=${String(t.key)}>
1184
- ${e.configuring?R(e,t):n.html`<i class="sf-icon" aria-hidden="true">${t.icon?String(t.icon):"folder"}</i>`}
1297
+ ${e.configuring?D(e,t):r.html`<i class="sf-icon" aria-hidden="true">${t.icon?String(t.icon):"folder"}</i>`}
1185
1298
  ${p(e,"section",String(t.key),String(t.label??t.key),"sf-property-view-section-title min-w-0")}
1186
1299
  <sf-button-icon
1187
1300
  size="1/2"
@@ -1189,13 +1302,13 @@
1189
1302
  scheme="secondary"
1190
1303
  icon="delete"
1191
1304
  data-action="remove-section"
1192
- ?disabled=${i<2}
1305
+ ?disabled=${n<2}
1193
1306
  title=${e.removeSectionText}
1194
1307
  aria-label=${e.removeSectionText}
1195
1308
  @click=${()=>e.component.removeSection(String(t.key))}
1196
1309
  ></sf-button-icon>
1197
1310
  </div>
1198
- `:n.nothing}function R(e,t){const i=t.icon?String(t.icon):"",r=e.sectionIconChoices.map(e=>({kind:"icon",icon:e,text:e,value:e,ariaLabel:e,selected:e===i}));return n.html`
1311
+ `:r.nothing}function D(e,t){const n=t.icon?String(t.icon):"",i=e.sectionIconChoices.map(e=>({kind:"icon",icon:e,text:e,value:e,ariaLabel:e,selected:e===n}));return r.html`
1199
1312
  <sf-dropdown
1200
1313
  class="sf-property-view-section-icon"
1201
1314
  size="1/2"
@@ -1205,25 +1318,25 @@
1205
1318
  search-placeholder=${e.sectionIconText}
1206
1319
  aria-label=${e.sectionIconText}
1207
1320
  data-icon-for=${String(t.key)}
1208
- value=${i}
1209
- .options=${r}
1210
- @change=${i=>e.component.setSectionIcon(String(t.key),i.detail?.value??"")}
1321
+ value=${n}
1322
+ .options=${i}
1323
+ @change=${n=>e.component.setSectionIcon(String(t.key),n.detail?.value??"")}
1211
1324
  >
1212
1325
  <sf-button-icon
1213
1326
  slot="trigger"
1214
1327
  size="1/2"
1215
1328
  appearance="link"
1216
1329
  scheme="on-surface"
1217
- icon=${i||"folder"}
1330
+ icon=${n||"folder"}
1218
1331
  data-action="section-icon"
1219
1332
  title=${e.sectionIconText}
1220
1333
  aria-label=${e.sectionIconText}
1221
1334
  ></sf-button-icon>
1222
1335
  </sf-dropdown>
1223
- `}function M(e){const t=e.viewProfiles??[];return t.length?n.html`
1336
+ `}function M(e){const t=e.viewProfiles??[];return t.length?r.html`
1224
1337
  <section class="sf-property-view-profiles flex flex-col gap-1/3">
1225
1338
  <h3 class="sf-property-view-profiles-title">${e.viewProfileLabel}</h3>
1226
- ${t.map(t=>n.html`
1339
+ ${t.map(t=>r.html`
1227
1340
  <div class="sf-property-view-profile flex items-cross-center gap-1/3" data-profile=${t.id}>
1228
1341
  <sf-input
1229
1342
  size="1/2"
@@ -1232,7 +1345,7 @@
1232
1345
  value=${t.label}
1233
1346
  aria-label=${t.label}
1234
1347
  data-action="rename-profile"
1235
- @change=${i=>e.component.renameViewProfile(t.id,i.detail?.value??i.target?.value??"")}
1348
+ @change=${n=>e.component.renameViewProfile(t.id,n.detail?.value??n.target?.value??"")}
1236
1349
  ></sf-input>
1237
1350
  <span class="sf-property-view-profile-scope color-on-surface-variant">
1238
1351
  ${t.shared?e.sharedLayerText:e.personalLayerText}
@@ -1250,7 +1363,7 @@
1250
1363
  ></sf-button-icon>
1251
1364
  </div>
1252
1365
  `)}
1253
- ${e.namingView?N(e):n.html`
1366
+ ${e.namingView?N(e):r.html`
1254
1367
  <sf-button
1255
1368
  appearance="outline"
1256
1369
  scheme="on-surface"
@@ -1260,7 +1373,7 @@
1260
1373
  @click=${()=>e.component.startNamingView()}
1261
1374
  ></sf-button>`}
1262
1375
  </section>
1263
- `:n.nothing}function N(e){const t=t=>{const i=t.target?.closest?.(".sf-property-view-rename")?.querySelector("sf-input");e.component.createViewProfile(i?.value??"")};return n.html`
1376
+ `:r.nothing}function N(e){const t=t=>{const n=t.target?.closest?.(".sf-property-view-rename")?.querySelector("sf-input");e.component.createViewProfile(n?.value??"")};return r.html`
1264
1377
  <span class="sf-property-view-rename flex items-cross-center gap-1/4 min-w-0" data-action="new-profile">
1265
1378
  <sf-input
1266
1379
  size="1/2"
@@ -1270,7 +1383,7 @@
1270
1383
  data-action="new-profile-input"
1271
1384
  aria-label=${e.addViewText}
1272
1385
  placeholder=${e.newViewText}
1273
- @keydown=${i=>{"Enter"===i.key&&t(i),"Escape"===i.key&&e.component.cancelNamingView()}}
1386
+ @keydown=${n=>{"Enter"===n.key&&t(n),"Escape"===n.key&&e.component.cancelNamingView()}}
1274
1387
  ></sf-input>
1275
1388
  <sf-button-icon
1276
1389
  size="1/2"
@@ -1293,7 +1406,7 @@
1293
1406
  @click=${()=>e.component.cancelNamingView()}
1294
1407
  ></sf-button-icon>
1295
1408
  </span>
1296
- `}function U(e,t){return n.html`
1409
+ `}function j(e,t){return r.html`
1297
1410
  <div class="sf-property-view-additions flex flex-col items-cross-stretch gap-1">
1298
1411
  <sf-button
1299
1412
  appearance="outline"
@@ -1303,10 +1416,10 @@
1303
1416
  data-action="add-group"
1304
1417
  @click=${()=>e.component.addGroup(t?String(t.key):"")}
1305
1418
  ></sf-button>
1306
- ${B(e)?n.nothing:j(e)}
1419
+ ${B(e)?r.nothing:U(e)}
1307
1420
  ${M(e)}
1308
1421
  </div>
1309
- `}function j(e){return n.html`
1422
+ `}function U(e){return r.html`
1310
1423
  <sf-button
1311
1424
  appearance="outline"
1312
1425
  scheme="on-surface"
@@ -1315,31 +1428,31 @@
1315
1428
  data-action="add-section"
1316
1429
  @click=${()=>e.component.addSection()}
1317
1430
  ></sf-button>
1318
- `}function B(e){const t=l(e,e.sections);return Boolean(e.wide&&"list"===e.sectionsAs&&(t.length>1||e.configuring))}const G=["w-1/3","w-2/3","w-1/2","w-3/4","w-2/5"],H=3,W=3;function K(e){const t=e=>n.html`<div class="sf-skeleton sf-skeleton--animation-pulse" aria-hidden="true"><div class="sf-skeleton-text sf-skeleton-text--size-1 ${G[e%G.length]}"></div></div>`,i=n.html`<div class="sf-property-view-tabs sf-property-view-tabs--skeleton flex items-cross-center gap-2" aria-hidden="true" data-sf-skeleton="tabs" data-sections-as=${e.sectionsAs}>${[0,1,2].map(e=>n.html`<div class="flex-none" style="inline-size: 6rem">${t(e+3)}</div>`)}</div>`;return n.html`${i}<div class="sf-property-view-loading flex flex-col gap-4" data-state="loading">${Array.from({length:H},(e,i)=>n.html`<section class="sf-property-view-group bg-surface-0 flex flex-col gap-2" aria-busy="true"><header class="sf-property-view-group-header flex items-cross-center content-main-between gap-2"><div class="flex-1">${t(i)}</div></header>${Array.from({length:W},(e,r)=>t(i+r+1))}</section>`)}<span class="sr-only" role="status">${e.message}</span></div>`}function J(e){const t=e.loadFailure;return n.html`<sf-empty-state kind=${t.kind} size=${"1/2"===e.size?"1/2":"1"} heading-level="2"
1319
- text=${t.text||n.nothing}
1431
+ `}function B(e){const t=l(e,e.sections);return Boolean(e.wide&&"list"===e.sectionsAs&&(t.length>1||e.configuring))}const G=["w-1/3","w-2/3","w-1/2","w-3/4","w-2/5"],W=3,H=3;function K(e){const t=e=>r.html`<div class="sf-skeleton sf-skeleton--animation-pulse" aria-hidden="true"><div class="sf-skeleton-text sf-skeleton-text--size-1 ${G[e%G.length]}"></div></div>`,n=r.html`<div class="sf-property-view-tabs sf-property-view-tabs--skeleton flex items-cross-center gap-2" aria-hidden="true" data-sf-skeleton="tabs" data-sections-as=${e.sectionsAs}>${[0,1,2].map(e=>r.html`<div class="flex-none" style="inline-size: 6rem">${t(e+3)}</div>`)}</div>`;return r.html`${n}<div class="sf-property-view-loading flex flex-col gap-4" data-state="loading">${Array.from({length:W},(e,n)=>r.html`<section class="sf-property-view-group bg-surface-0 flex flex-col gap-2" aria-busy="true"><header class="sf-property-view-group-header flex items-cross-center content-main-between gap-2"><div class="flex-1">${t(n)}</div></header>${Array.from({length:H},(e,i)=>t(n+i+1))}</section>`)}<span class="sr-only" role="status">${e.message}</span></div>`}function J(e){const t=e.loadFailure;return r.html`<sf-empty-state kind=${t.kind} size=${"1/2"===e.size?"1/2":"1"} heading-level="2"
1432
+ text=${t.text||r.nothing}
1320
1433
  .actions=${"error"===t.kind?null:[]}
1321
- @sf-empty-state-action=${t=>{"retry"===t.detail?.id&&e.component.load("retry")}}></sf-empty-state>`}function Y(e,t=!1,i=!0){if(e.loading)return K(e);if(e.loadFailure)return J(e);const r=l(e,e.sections),s=r.find(t=>String(t.key)===e.selectedSection)??r[0]??null;return n.html`
1434
+ @sf-empty-state-action=${t=>{"retry"===t.detail?.id&&e.component.load("retry")}}></sf-empty-state>`}function Y(e,t=!1,n=!0){if(e.loading)return K(e);if(e.loadFailure)return J(e);const i=l(e,e.sections),s=i.find(t=>String(t.key)===e.selectedSection)??i[0]??null;return r.html`
1322
1435
  <div class="sf-property-view-status" role="status" aria-live="polite" ?hidden=${!e.message}>
1323
1436
  ${e.message}
1324
1437
  </div>
1325
- ${!e.panel&&(e.hasHostSlot("actions")||e.hasHostSlot("menu")||e.panelMenuItems.length)?n.html`
1438
+ ${!e.panel&&(e.hasHostSlot("actions")||e.hasHostSlot("menu")||e.panelMenuItems.length)?r.html`
1326
1439
  <div class="sf-property-view-host-actions flex flex-wrap items-cross-center justify-end gap-1">
1327
- ${e.hasHostSlot("actions")?e.hostSlot("actions"):n.nothing}
1440
+ ${e.hasHostSlot("actions")?e.hostSlot("actions"):r.nothing}
1328
1441
  ${q(e)}
1329
- </div>`:n.nothing}
1330
- ${D(e,r)?b(e,r):n.nothing}
1331
- ${e.wide&&"tabs"===e.sectionsAs&&r.length>1?k(e,r):n.nothing}
1442
+ </div>`:r.nothing}
1443
+ ${I(e,i)?y(e,i):r.nothing}
1444
+ ${e.wide&&"tabs"===e.sectionsAs&&i.length>1?T(e,i):r.nothing}
1332
1445
  <div class="sf-property-view-layout"
1333
1446
  style=${`--sf-property-view--sections-width: ${e.sectionsWidth};${e.panel?"":_(e)}`}
1334
- data-sections=${String(r.length)}
1335
- data-screen=${D(e,r)?"sections":"groups"}>
1336
- ${!e.wide&&r.length>1&&null!==e.phoneSection?y(e):n.nothing}
1337
- ${B(e)&&!t?w(e,r):n.nothing}
1338
- ${e.isEmptyRecord&&!e.configuring?n.html`<p class="sf-property-view-empty-record color-on-surface-variant"
1339
- role="status">${e.emptyRecordText}</p>`:n.nothing}
1340
- ${D(e,r)?n.nothing:e.configuring?n.html`
1447
+ data-sections=${String(i.length)}
1448
+ data-screen=${I(e,i)?"sections":"groups"}>
1449
+ ${!e.wide&&i.length>1&&null!==e.phoneSection?b(e):r.nothing}
1450
+ ${B(e)&&!t?w(e,i):r.nothing}
1451
+ ${e.isEmptyRecord&&!e.configuring?r.html`<p class="sf-property-view-empty-record color-on-surface-variant"
1452
+ role="status">${e.emptyRecordText}</p>`:r.nothing}
1453
+ ${I(e,i)?r.nothing:e.configuring?r.html`
1341
1454
  <div class="sf-property-view-body flex-auto min-w-0 flex flex-col gap-4">
1342
- ${I(e,s,r.length)}
1455
+ ${R(e,s,i.length)}
1343
1456
  <sf-sortable
1344
1457
  class="sf-property-view-groups flex flex-col gap-4"
1345
1458
  group="group"
@@ -1347,23 +1460,23 @@
1347
1460
  id=${`group:${s?String(s.key):""}`}
1348
1461
  label=${String(s?.label??s?.key??"")}
1349
1462
  >${l(e,s?.groups).map(t=>v(e,s,t))}</sf-sortable>
1350
- ${U(e,s)}
1463
+ ${j(e,s)}
1351
1464
  ${E(e)}
1352
- </div>`:n.html`
1465
+ </div>`:r.html`
1353
1466
  <div class="sf-property-view-body flex-auto min-w-0 flex flex-col gap-4">
1354
1467
  ${e.visible(s?.groups).map(t=>v(e,s,t))}
1355
1468
  </div>`}
1356
1469
  </div>
1357
- ${i&&e.hasHostSlot("footer")?n.html`<div class="sf-property-view-host-footer flex flex-wrap items-cross-center gap-2">${e.hostSlot("footer")}</div>`:n.nothing}
1358
- ${i?C(e):n.nothing}
1359
- `}function X(e){if(!e.panel)return Y(e);const t=B(e);return n.html`
1470
+ ${n&&e.hasHostSlot("footer")?r.html`<div class="sf-property-view-host-footer flex flex-wrap items-cross-center gap-2">${e.hostSlot("footer")}</div>`:r.nothing}
1471
+ ${n?C(e):r.nothing}
1472
+ `}function X(e){if(!e.panel)return Y(e);const t=B(e);return r.html`
1360
1473
  <sf-drawer
1361
1474
  ?open=${e.panelOpen}
1362
1475
  placement="inline-end"
1363
1476
  modal="true"
1364
1477
  overlay="true"
1365
1478
  size=${e.wide?e.panelSize:"full"}
1366
- width=${e.wide&&e.drawerWidth||n.nothing}
1479
+ width=${e.wide&&e.drawerWidth||r.nothing}
1367
1480
  gutter="var(--sf-space-1)"
1368
1481
  panel-style=${`--sf-drawer-background: var(--sf-surface-1); --sf-property-view--sections-width: ${e.sectionsWidth}; scrollbar-gutter: auto;${_(e)}`}
1369
1482
  show-close="false"
@@ -1371,16 +1484,16 @@
1371
1484
  close-on-esc="false"
1372
1485
  label=${e.panelLabel||e.recordId||""}
1373
1486
  >
1374
- ${O(e)}
1487
+ ${V(e)}
1375
1488
  <div class="sf-property-view-panel relative flex flex-col gap-2${t?" sf-property-view-panel--railed":""}${P(e)?" sf-property-view-panel--fills":""}"
1376
- style=${P(e)?`--sf-property-view--edge-room: calc(${e.edgeControlCount} * ${e.edgeControlWidth} + ${e.edgeControlCount-1} * var(--sf-space-1\\/2));`:n.nothing}
1489
+ style=${P(e)?`--sf-property-view--edge-room: calc(${e.edgeControlCount} * ${e.edgeControlWidth} + ${e.edgeControlCount-1} * var(--sf-space-1\\/2));`:r.nothing}
1377
1490
  data-record-id=${e.recordId||""}
1378
1491
  data-stack-depth=${String(e.stackDepth)}
1379
1492
  data-stacked=${e.isTopPanel?"false":"true"}
1380
1493
  >
1381
- ${V(e)}
1494
+ ${L(e)}
1382
1495
  <div class="sf-property-view-scroll flex-auto min-h-0 ${t?"flex":"flex flex-col"}">
1383
- ${t?n.html`
1496
+ ${t?r.html`
1384
1497
  ${w(e,l(e,e.sections))}
1385
1498
  <div class="sf-property-view-frame flex-auto min-w-0 flex flex-col gap-2">
1386
1499
  ${Y(e,!0,!1)}
@@ -1389,4 +1502,4 @@
1389
1502
  ${C(e,{panel:!0})}
1390
1503
  </div>
1391
1504
  </sf-drawer>
1392
- `}r()}catch(Z){r(Z)}})},"2f31b00ad99a"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{x:()=>p});var n=i("e577837dd70a"),s=e([n]),o=s.then?(await s)():s;n=o[0];const a=/^(\d{4})-(\d{2})-(\d{2})$/u,l=/^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?$/u,c=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?$/u,u=new Set(["date","datetime","time"]);function d(e,t){const i=a.exec(t);if(i)return new Date(Number(i[1]),Number(i[2])-1,Number(i[3]));const r=l.exec(t);if(r)return"time"===e?new Date(2e3,0,1,Number(r[1]),Number(r[2]),Number(r[3]??0)):null;const n=c.exec(t);if(!n)return null;if(n[7]){const e=new Date(t.replace(" ","T"));return Number.isNaN(e.getTime())?null:e}return new Date(Number(n[1]),Number(n[2])-1,Number(n[3]),Number(n[4]),Number(n[5]),Number(n[6]??0))}function p(e,t,i){if(!u.has(e)||"string"!=typeof t||!t.trim())return"";const r=t.trim(),s=d(e,r);if(!s)return"";const o="date"!==e&&!a.test(r);return"time"===e?(0,n.Yq)(s,{date:null,time:"short",node:i}):(0,n.Yq)(s,{date:"medium",time:o?"short":null,node:i})}r()}catch(h){r(h)}})},"17828be41e75"(e,t,i){i.d(t,{C3:()=>s,l6:()=>o});const r=e=>String(e).replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase());function n(e,t){if(null==e||!0===e||e===t)return{outcome:"applied"};if(!1===e)return{outcome:"refused",reason:"refused"};if("object"==typeof e&&"string"==typeof e.outcome)return e;if("object"==typeof e&&"string"==typeof e.answer){const{answer:t,reason:i,message:r}=e;return{...e,outcome:t,...i?{reason:i}:{},...r?{message:r}:{}}}return{outcome:"applied",value:e}}function s(e,t){const i=e.prototype;for(const[e,s]of Object.entries(t.actions||{})){const t=r(e),o=i[t];if("function"!=typeof o||o.sfAction)continue;const a=Object.keys(s?.with||{}),l=function(...e){if(1===e.length&&(null!==(t=e[0])&&"object"==typeof t&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype)){const t=Object.keys(e[0]);a.length||t.length?a.length&&t.length&&t.every(e=>a.includes(e)||a.map(r).includes(e))&&(e=a.map(t=>e[0][t]??e[0][r(t)])):e=[]}var t;const i=o.apply(this,e);return i&&"function"==typeof i.then?i.then(e=>n(e,this)):n(i,this)};l.sfAction=!0,Object.defineProperty(i,t,{configurable:!0,writable:!0,value:l})}return e}function o(e,t){const i=e.prototype;for(const[e,n]of Object.entries(t.settings||{})){if(["list","object","state"].includes(n?.type))continue;const t=r(e);let s=i,o=null;for(;s&&s!==globalThis.HTMLElement?.prototype&&s!==Object.prototype&&(o=Object.getOwnPropertyDescriptor(s,t),!o);)s=Object.getPrototypeOf(s);o&&o.get&&!o.set&&Object.defineProperty(s,t,{configurable:!0,get:o.get,set(t){"boolean"===n.type?!0===t||""===t||"true"===t?this.setAttribute(e,""):!1===t&&!0===n.default?this.setAttribute(e,"false"):this.removeAttribute(e):null==t?this.removeAttribute(e):this.setAttribute(e,String(t))}})}return e}},"5b7d7695b41b"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("element-manifest",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("element-manifest",1).then(e,t),{once:!0}))},"18003344cff0"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("layer-stack",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("layer-stack",1).then(e,t),{once:!0}))},"073f05ff1a81"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1).then(e,t),{once:!0}))},"2a080a730149"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit",1).then(e,t),{once:!0}))},"43090d1c8307"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("page-language",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("page-language",1).then(e,t),{once:!0}))},deb1a4d61565(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("smart-base",1).then(e,t),{once:!0}))},"4284cc8c32e1"(e){e.exports=JSON.parse('{"$comment":"Dated aliases of sf-view-properties for the shim (core/js/aliases.js, standard §16 item 20).","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","aliases":[{"from":"aria-label","to":null,"kind":"attribute","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"host-attribute","section":"§3.1, §4.8","note":"stays a host attribute, read for the accessible name; no shim"},{"from":"sf-property-view-open-record","to":"sf-property-view-open","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 open","note":"ui-admin listens to it (src/polygon.ts:124); the detail {field, value, answer} is unchanged"},{"from":"sf-property-view-delete-record","to":"sf-property-view-delete","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 delete","note":"the detail {record_id, collection, revision, answer} is unchanged"},{"from":"sf-property-view","to":"sf-view-properties","kind":"tag","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","section":"rename plan R2 (ui-control RENAME-PLAN-2026-11-03), naming decision 2026-11-02","note":"the element is sf-view-properties; sf-property-view is a subclass defined beside it until the date"},{"from":"sf-property-view-close","to":"sf-view-properties-close","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open-full","to":"sf-view-properties-open-full","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-saved","to":"sf-view-properties-saved","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-failed","to":"sf-view-properties-failed","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open","to":"sf-view-properties-open","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-delete","to":"sf-view-properties-delete","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-created","to":"sf-view-properties-created","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-cancel","to":"sf-view-properties-cancel","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-state","to":"sf-view-properties-state","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-address-copy","to":"sf-view-properties-address-copy","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-favourite","to":"sf-view-properties-favourite","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"}]}')},"3ea81f4c3c20"(e){e.exports=JSON.parse('{"id":"smart.view-properties","tag":"sf-view-properties","version":"1.10.0","kind":"leaf","implements":["record-view@1"],"settings":{"add-field-text":{"type":"string","default-from":"runtime.add-field-text"},"add-group-text":{"type":"string","default-from":"runtime.add-group-text"},"add-section-text":{"type":"string","default-from":"runtime.add-section-text"},"back-label":{"type":"string","default-from":"runtime.back-label"},"cancel-configuring-text":{"type":"string","default-from":"runtime.cancel-configuring-text"},"cancel-name-text":{"type":"string","default-from":"runtime.cancel-name-text"},"cancel-text":{"type":"string","default-from":"runtime.cancel-text"},"changed-text":{"type":"string","default-from":"runtime.changed-text"},"close-label":{"type":"string","default-from":"runtime.close-label"},"collection":{"type":"string","default":""},"collection-icon":{"type":"icon","default":""},"collection-label":{"type":"string","default":""},"configure-hint-narrow-text":{"type":"string","default-from":"runtime.configure-hint-narrow-text"},"configure-hint-text":{"type":"string","default-from":"runtime.configure-hint-text"},"configure-text":{"type":"string","default-from":"runtime.configure-text"},"conflict-text":{"type":"string","default-from":"runtime.conflict-text"},"copy-link-label":{"type":"string","default-from":"runtime.copy-link-label"},"delete-text":{"type":"string","default-from":"runtime.delete-text"},"done-configuring-text":{"type":"string","default-from":"runtime.done-configuring-text"},"edit-text":{"type":"string","default-from":"runtime.edit-text"},"empty-record-text":{"type":"string","default-from":"runtime.empty-record-text"},"empty-text":{"type":"string","default-from":"runtime.empty-text"},"errors-text":{"type":"string","default-from":"runtime.errors-text"},"favourite":{"type":"boolean","default":false},"favourite-label":{"type":"string","default-from":"runtime.favourite-label"},"field-label-text":{"type":"string","default-from":"runtime.field-label-text"},"field-settings-text":{"type":"string","default-from":"runtime.field-settings-text"},"hidden-text":{"type":"string","default-from":"runtime.hidden-text"},"hide-rare-text":{"type":"string","default-from":"runtime.hide-rare-text"},"hint-text":{"type":"string","default-from":"runtime.hint-text"},"in-this-group-text":{"type":"string","default-from":"runtime.in-this-group-text"},"inherited-text":{"type":"string","default-from":"runtime.inherited-text"},"link-copied-label":{"type":"string","default-from":"runtime.link-copied-label"},"menu-label":{"type":"string","default-from":"runtime.menu-label"},"move-down-text":{"type":"string","default-from":"runtime.move-down-text"},"move-up-text":{"type":"string","default-from":"runtime.move-up-text"},"new-group-title":{"type":"string","default-from":"runtime.new-group-title"},"new-section-title":{"type":"string","default-from":"runtime.new-section-title"},"no-match-text":{"type":"string","default-from":"runtime.no-match-text"},"open-full-label":{"type":"string","default-from":"runtime.open-full-label"},"panel":{"type":"boolean","default":false},"panel-label":{"type":"string","default":""},"panel-size":{"type":"enum","values":["1/2","1","2","full"],"default":"1"},"size":{"type":"enum","values":["1","1/2"],"default":"1"},"mode":{"type":"enum","values":["view","auto","edit","create"],"default":"auto"},"panel-width":{"type":"string","default":""},"personal-layer-text":{"type":"string","default-from":"runtime.personal-layer-text"},"rare-text":{"type":"string","default-from":"runtime.rare-text"},"record-id":{"type":"id","default":""},"remove-field-text":{"type":"string","default-from":"runtime.remove-field-text"},"remove-group-text":{"type":"string","default-from":"runtime.remove-group-text"},"remove-section-text":{"type":"string","default-from":"runtime.remove-section-text"},"rename-text":{"type":"string","default-from":"runtime.rename-text"},"reset-view-ask-text":{"type":"string","default-from":"runtime.reset-view-ask-text"},"reset-view-text":{"type":"string","default-from":"runtime.reset-view-text"},"save-name-text":{"type":"string","default-from":"runtime.save-name-text"},"save-text":{"type":"string","default-from":"runtime.save-text"},"section-icon-text":{"type":"string","default-from":"runtime.section-icon-text"},"section-icons":{"type":"string","default":""},"sections-as":{"type":"enum","values":["list","tabs"],"default":"list"},"sections-label":{"type":"string","default-from":"runtime.sections-label"},"shared-layer-text":{"type":"string","default-from":"runtime.shared-layer-text"},"show-rare":{"type":"boolean","default":false},"show-rare-text":{"type":"string","default-from":"runtime.show-rare-text"},"shown-text":{"type":"string","default-from":"runtime.shown-text"},"unplaced-hint-text":{"type":"string","default-from":"runtime.unplaced-hint-text"},"unplaced-title":{"type":"string","default-from":"runtime.unplaced-title"},"variant-text":{"type":"string","default-from":"runtime.variant-text"},"view-conflict-text":{"type":"string","default-from":"runtime.view-conflict-text"},"view-denied-text":{"type":"string","default-from":"runtime.view-denied-text"},"width-text":{"type":"string","default-from":"runtime.width-text"},"view-profile-label":{"type":"string","default-from":"runtime.view-profile-label"},"add-view-text":{"type":"string","default-from":"runtime.add-view-text"},"new-view-text":{"type":"string","default-from":"runtime.new-view-text"},"delete-view-text":{"type":"string","default-from":"runtime.delete-view-text"},"last-shared-view-text":{"type":"string","default-from":"runtime.last-shared-view-text"},"full":{"type":"boolean","default":false},"open":{"type":"boolean","default":true}},"values":{"revision":{"type":"string"},"section":{"type":"string"}},"events":{"close":{"carries":{"reason":{"type":"enum","values":["close","escape","cancelled","deleted","api"]},"record_id":{"type":"id","nullable":true},"unsaved_fields":{"type":"list"}},"cancelable":true},"open-full":{"carries":{"id":"id","address":"string","record_id":{"type":"id","nullable":true}}},"saved":{"carries":{"id":"id","revision":{"type":"string","optional":true}}},"failed":{"carries":{"reason":"string","message":{"type":"string","optional":true}}},"open":{"carries":{"field":"string","value":"object","answer":"string"}},"delete":{"carries":{"collection":"string","revision":"string","answer":"string","record_id":{"type":"id","nullable":true}}},"created":{"carries":{"collection":{"type":"string","nullable":true},"record_id":{"type":"id","nullable":true}}},"cancel":{"carries":{"mode":{"type":"enum","values":["auto","edit","create"]},"scope":{"type":"enum","values":["group"],"optional":true},"section":{"type":"string","optional":true},"group":{"type":"string","optional":true}}},"state":{"carries":{"state":"string","message":"string"},"own-verb":true},"address-copy":{"carries":{},"own-verb":true},"favourite":{"carries":{"collection":{"type":"string","nullable":true},"favourite":"boolean","record_id":{"type":"id","nullable":true}},"own-verb":true}},"actions":{"refresh":{},"load":{"with":{"reason":{"type":"string","optional":true}}},"edit-group":{"with":{"section":"string","group":"string"}},"cancel-edit":{},"save-group":{"with":{"options":{"type":"object","optional":true}},"concurrency":"drop"},"select-section":{"with":{"key":"string"}},"close-panel":{"with":{"reason":{"type":"string","optional":true}}},"copy-address":{},"open-full-page":{},"confirm-save":{},"cancel-confirmation":{}},"port":{"id":"simai.property-view-port","version":"1.17.0","contract":"src/core/contracts/ports/simai.property-view-port/1.17.0/port.json"},"presentation":{"skeleton":{"file":"skeleton.html","late":[]}},"css-variables":{"--sf-property-view--sections-width":{"type":"length","state":"default"},"--sf-property-view--title-size":{"type":"length","state":"default"},"--sf-property-view--label-size":{"type":"length","state":"default"},"--sf-property-view--value-size":{"type":"length","state":"default"},"--sf-property-view--group-size":{"type":"length","state":"default"},"--sf-property-view--edge-room":{"type":"length","state":"open"}},"host-states":{"data-state":"string","aria-busy":"string"}}')},"99fb492b7fba"(e){e.exports=JSON.parse('{"title":"Property view","events":{"state":{"label":"Record state"},"address-copy":{"label":"Address copied"},"favourite":{"label":"Favourite"}},"runtime":{"add-field-text":"Add a field","add-group-text":"Add an area","add-section-text":"Add a section","add-view-text":"Add a view","back-label":"Back","cancel-configuring-text":"Cancel","cancel-name-text":"Leave the name","cancel-text":"Cancel","changed-text":"Fields changed","close-label":"Close","configure-hint-narrow-text":"Drag fields between groups. Applied at once.","configure-hint-text":"Drag fields between groups and onto a section on the left. Applied at once.","configure-text":"Arrange the view","confirm-save-text":"Confirm and save","conflict-text":"The record changed; read it again","copy-link-label":"Copy link","create-text":"Create","delete-text":"Delete","delete-view-text":"Remove the view","done-configuring-text":"Done","edit-text":"edit","empty-record-text":"This record has nothing to show","empty-text":"not filled in","errors-text":"Errors","favourite-label":"Favourite","field-label-text":"Name","field-settings-text":"Field settings","hidden-text":"Hide","hide-rare-text":"Hide rare fields","hint-text":"Hint","in-this-group-text":"In this area","inherited-text":"by default","keep-editing-text":"Keep editing","last-shared-view-text":"The only view everyone has","link-copied-label":"Link copied","menu-label":"More","move-down-text":"Move down","move-up-text":"Move up","new-group-title":"New area","new-section-title":"New section","new-view-text":"New view","no-match-text":"Nothing matches","open-full-label":"Open as a page","personal-layer-text":"Personal","rare-text":"rare","read-only-text":"You can only view this record","remove-field-text":"Remove from this area","remove-group-text":"Remove this area","remove-section-text":"Remove this section","rename-text":"Rename","reset-view-ask-text":"Reset the whole view?","reset-view-text":"Reset","save-failed-text":"The save failed","save-name-text":"Save the name","save-text":"Save","section-icon-text":"Section glyph","sections-label":"Sections","shared-layer-text":"Everyone\'s","show-rare-text":"Show rare fields","shown-text":"Shown","state-load-failed":"The record could not be read","state-loading":"Reading the record","state-port-not-connected":"The record port is not connected","state-unavailable":"The record is unavailable","unplaced-hint-text":"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out.","unplaced-title":"Not placed","variant-text":"Template","view-conflict-text":"The view changed and was read again","view-denied-text":"You may not change this layer","view-profile-label":"View","view-reset-failed-text":"The view could not be reset","view-save-failed-text":"The view could not be saved","width-text":"Full width"}}')},d614908e644f(e){e.exports=JSON.parse('{"title":"Запись","events":{"state":{"label":"Состояние записи"},"address-copy":{"label":"Адрес скопирован"},"favourite":{"label":"Избранное"}},"runtime":{"add-field-text":"Добавить поле","add-group-text":"Добавить область","add-section-text":"Добавить раздел","add-view-text":"Добавить вид","back-label":"Назад","cancel-configuring-text":"Отменить","cancel-name-text":"Оставить название","cancel-text":"Отменить","changed-text":"Изменено полей","close-label":"Закрыть","configure-hint-narrow-text":"Перетаскивайте поля между группами. Применяется сразу.","configure-hint-text":"Перетаскивайте поля между группами и на разделы слева. Применяется сразу.","configure-text":"Настроить вид","confirm-save-text":"Подтвердить и сохранить","conflict-text":"Запись изменилась, обновите её","copy-link-label":"Копировать ссылку","create-text":"Создать","delete-text":"Удалить","delete-view-text":"Удалить вид","done-configuring-text":"Готово","edit-text":"изменить","empty-record-text":"В этой записи нечего показать","empty-text":"не заполнено","errors-text":"Ошибок","favourite-label":"В избранное","field-label-text":"Название","field-settings-text":"Настройки поля","hidden-text":"Скрыть","hide-rare-text":"Скрыть редкие поля","hint-text":"Подсказка","in-this-group-text":"В этой области","inherited-text":"по умолчанию","keep-editing-text":"Вернуться к правке","last-shared-view-text":"Единственный общий вид","link-copied-label":"Ссылка скопирована","menu-label":"Ещё","move-down-text":"Ниже","move-up-text":"Выше","new-group-title":"Новая область","new-section-title":"Новый раздел","new-view-text":"Новый вид","no-match-text":"Ничего не найдено","open-full-label":"Открыть на всю страницу","personal-layer-text":"Персональный","rare-text":"редкое","read-only-text":"Эту запись можно только смотреть","remove-field-text":"Убрать из области","remove-group-text":"Удалить область","remove-section-text":"Удалить раздел","rename-text":"Переименовать","reset-view-ask-text":"Сбросить весь вид?","reset-view-text":"Сбросить","save-failed-text":"Не удалось сохранить","save-name-text":"Сохранить название","save-text":"Сохранить","section-icon-text":"Значок раздела","sections-label":"Разделы","shared-layer-text":"Для всех","show-rare-text":"Показать редкие поля","shown-text":"Показывать","state-load-failed":"Не удалось загрузить запись","state-loading":"Загрузка записи","state-port-not-connected":"Порт записи не подключён","state-unavailable":"Запись недоступна","unplaced-hint-text":"Поля, которых нет в этом виде. Перетащите поле в группу, чтобы разместить, или сюда, чтобы убрать.","unplaced-title":"Не размещённые","variant-text":"Вид","view-conflict-text":"Вид изменился, он перезагружен","view-denied-text":"Нет права менять этот слой","view-profile-label":"Вид","view-reset-failed-text":"Не удалось сбросить вид","view-save-failed-text":"Не удалось сохранить вид","width-text":"На всю ширину"}}')}};const t={};function i(r){const n=t[r];if(void 0!==n)return n.exports;const s=t[r]={exports:{}};return e[r](s,s.exports,i),s.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",r=e?Symbol("webpack exports"):"__webpack_exports__",n=e?Symbol("webpack error"):"__webpack_error__",s=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};i.a=(e,i,o)=>{let a;o&&((a=[]).d=-1);const l=new Set,c=e.exports;let u,d,p;const h=new Promise((e,t)=>{p=t,d=e});h[r]=c,h[t]=e=>(a&&e(a),l.forEach(e),h.catch(e=>{})),e.exports=h;i(e=>{let i;u=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const i=[];i.d=0,e.then(e=>{o[r]=e,s(i)},e=>{o[n]=e,s(i)});const o={};return o[t]=e=>e(i),o}}const i={};return i[t]=e=>{},i[r]=e,i}))(e);const o=()=>u.map(e=>{if(e[n])throw e[n];return e[r]}),c=new Promise(e=>{i=()=>e(o),i.r=0;const r=e=>e!==a&&!l.has(e)&&(l.add(e),e&&!e.d&&(i.r++,e.push(i)));u.map(e=>e[t](r))});return i.r?c:o()},e=>(e?p(h[n]=e):d(c),s(a))),a?.d<0&&(a.d=0)}})(),i.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var n=t[r++],s=t[r++];i.o(e,n)?0===s&&r++:0===s?Object.defineProperty(e,n,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,n,{enumerable:!0,get:s})}else for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);i("7623a90f1816")})();
1505
+ `}i()}catch(Z){i(Z)}})},"2f31b00ad99a"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{x:()=>p});var r=n("e577837dd70a"),s=e([r]),o=s.then?(await s)():s;r=o[0];const a=/^(\d{4})-(\d{2})-(\d{2})$/u,l=/^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?$/u,c=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?$/u,u=new Set(["date","datetime","time"]);function d(e,t){const n=a.exec(t);if(n)return new Date(Number(n[1]),Number(n[2])-1,Number(n[3]));const i=l.exec(t);if(i)return"time"===e?new Date(2e3,0,1,Number(i[1]),Number(i[2]),Number(i[3]??0)):null;const r=c.exec(t);if(!r)return null;if(r[7]){const e=new Date(t.replace(" ","T"));return Number.isNaN(e.getTime())?null:e}return new Date(Number(r[1]),Number(r[2])-1,Number(r[3]),Number(r[4]),Number(r[5]),Number(r[6]??0))}function p(e,t,n){if(!u.has(e)||"string"!=typeof t||!t.trim())return"";const i=t.trim(),s=d(e,i);if(!s)return"";const o="date"!==e&&!a.test(i);return"time"===e?(0,r.Yq)(s,{date:null,time:"short",node:n}):(0,r.Yq)(s,{date:"medium",time:o?"short":null,node:n})}i()}catch(h){i(h)}})},"17828be41e75"(e,t,n){n.d(t,{C3:()=>s,l6:()=>o});const i=e=>String(e).replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase());function r(e,t){if(null==e||!0===e||e===t)return{outcome:"applied"};if(!1===e)return{outcome:"refused",reason:"refused"};if("object"==typeof e&&"string"==typeof e.outcome)return e;if("object"==typeof e&&"string"==typeof e.answer){const{answer:t,reason:n,message:i}=e;return{...e,outcome:t,...n?{reason:n}:{},...i?{message:i}:{}}}return{outcome:"applied",value:e}}function s(e,t){const n=e.prototype;for(const[e,s]of Object.entries(t.actions||{})){const t=i(e),o=n[t];if("function"!=typeof o||o.sfAction)continue;const a=Object.keys(s?.with||{}),l=function(...e){if(1===e.length&&(null!==(t=e[0])&&"object"==typeof t&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype)){const t=Object.keys(e[0]);a.length||t.length?a.length&&t.length&&t.every(e=>a.includes(e)||a.map(i).includes(e))&&(e=a.map(t=>e[0][t]??e[0][i(t)])):e=[]}var t;const n=o.apply(this,e);return n&&"function"==typeof n.then?n.then(e=>r(e,this)):r(n,this)};l.sfAction=!0,Object.defineProperty(n,t,{configurable:!0,writable:!0,value:l})}return e}function o(e,t){const n=e.prototype;for(const[e,r]of Object.entries(t.settings||{})){if(["list","object","state"].includes(r?.type))continue;const t=i(e);let s=n,o=null;for(;s&&s!==globalThis.HTMLElement?.prototype&&s!==Object.prototype&&(o=Object.getOwnPropertyDescriptor(s,t),!o);)s=Object.getPrototypeOf(s);o&&o.get&&!o.set&&Object.defineProperty(s,t,{configurable:!0,get:o.get,set(t){"boolean"===r.type?!0===t||""===t||"true"===t?this.setAttribute(e,""):!1===t&&!0===r.default?this.setAttribute(e,"false"):this.removeAttribute(e):null==t?this.removeAttribute(e):this.setAttribute(e,String(t))}})}return e}},"5b7d7695b41b"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("element-manifest",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("element-manifest",1).then(e,t),{once:!0}))},"18003344cff0"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("layer-stack",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("layer-stack",1).then(e,t),{once:!0}))},"073f05ff1a81"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1).then(e,t),{once:!0}))},"2a080a730149"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit",1).then(e,t),{once:!0}))},"43090d1c8307"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("page-language",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("page-language",1).then(e,t),{once:!0}))},deb1a4d61565(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("smart-base",1).then(e,t),{once:!0}))},"4284cc8c32e1"(e){e.exports=JSON.parse('{"$comment":"Dated aliases of sf-view-properties for the shim (core/js/aliases.js, standard §16 item 20).","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","aliases":[{"from":"aria-label","to":null,"kind":"attribute","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"host-attribute","section":"§3.1, §4.8","note":"stays a host attribute, read for the accessible name; no shim"},{"from":"sf-property-view-open-record","to":"sf-property-view-open","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 open","note":"ui-admin listens to it (src/polygon.ts:124); the detail {field, value, answer} is unchanged"},{"from":"sf-property-view-delete-record","to":"sf-property-view-delete","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 delete","note":"the detail {record_id, collection, revision, answer} is unchanged"},{"from":"sf-property-view","to":"sf-view-properties","kind":"tag","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","section":"rename plan R2 (ui-control RENAME-PLAN-2026-11-03), naming decision 2026-11-02","note":"the element is sf-view-properties; sf-property-view is a subclass defined beside it until the date"},{"from":"sf-property-view-close","to":"sf-view-properties-close","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open-full","to":"sf-view-properties-open-full","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-saved","to":"sf-view-properties-saved","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-failed","to":"sf-view-properties-failed","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open","to":"sf-view-properties-open","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-delete","to":"sf-view-properties-delete","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-created","to":"sf-view-properties-created","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-cancel","to":"sf-view-properties-cancel","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-state","to":"sf-view-properties-state","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-address-copy","to":"sf-view-properties-address-copy","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-favourite","to":"sf-view-properties-favourite","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"}]}')},"3ea81f4c3c20"(e){e.exports=JSON.parse('{"id":"smart.view-properties","tag":"sf-view-properties","version":"1.11.0","kind":"leaf","implements":["record-view@1"],"settings":{"add-field-text":{"type":"string","default-from":"runtime.add-field-text"},"add-group-text":{"type":"string","default-from":"runtime.add-group-text"},"add-section-text":{"type":"string","default-from":"runtime.add-section-text"},"back-label":{"type":"string","default-from":"runtime.back-label"},"cancel-configuring-text":{"type":"string","default-from":"runtime.cancel-configuring-text"},"cancel-name-text":{"type":"string","default-from":"runtime.cancel-name-text"},"cancel-text":{"type":"string","default-from":"runtime.cancel-text"},"changed-text":{"type":"string","default-from":"runtime.changed-text"},"close-label":{"type":"string","default-from":"runtime.close-label"},"collection":{"type":"string","default":""},"collection-icon":{"type":"icon","default":""},"collection-label":{"type":"string","default":""},"configure-hint-narrow-text":{"type":"string","default-from":"runtime.configure-hint-narrow-text"},"configure-hint-text":{"type":"string","default-from":"runtime.configure-hint-text"},"configure-text":{"type":"string","default-from":"runtime.configure-text"},"conflict-text":{"type":"string","default-from":"runtime.conflict-text"},"copy-link-label":{"type":"string","default-from":"runtime.copy-link-label"},"delete-text":{"type":"string","default-from":"runtime.delete-text"},"done-configuring-text":{"type":"string","default-from":"runtime.done-configuring-text"},"edit-text":{"type":"string","default-from":"runtime.edit-text"},"empty-record-text":{"type":"string","default-from":"runtime.empty-record-text"},"empty-text":{"type":"string","default-from":"runtime.empty-text"},"errors-text":{"type":"string","default-from":"runtime.errors-text"},"favourite":{"type":"boolean","default":false},"favourite-label":{"type":"string","default-from":"runtime.favourite-label"},"field-label-text":{"type":"string","default-from":"runtime.field-label-text"},"field-settings-text":{"type":"string","default-from":"runtime.field-settings-text"},"hidden-text":{"type":"string","default-from":"runtime.hidden-text"},"hide-rare-text":{"type":"string","default-from":"runtime.hide-rare-text"},"hint-text":{"type":"string","default-from":"runtime.hint-text"},"in-this-group-text":{"type":"string","default-from":"runtime.in-this-group-text"},"inherited-text":{"type":"string","default-from":"runtime.inherited-text"},"link-copied-label":{"type":"string","default-from":"runtime.link-copied-label"},"menu-label":{"type":"string","default-from":"runtime.menu-label"},"move-down-text":{"type":"string","default-from":"runtime.move-down-text"},"move-up-text":{"type":"string","default-from":"runtime.move-up-text"},"new-group-title":{"type":"string","default-from":"runtime.new-group-title"},"new-section-title":{"type":"string","default-from":"runtime.new-section-title"},"no-match-text":{"type":"string","default-from":"runtime.no-match-text"},"open-full-label":{"type":"string","default-from":"runtime.open-full-label"},"panel":{"type":"boolean","default":false},"panel-label":{"type":"string","default":""},"panel-size":{"type":"enum","values":["1/2","1","2","full"],"default":"1"},"size":{"type":"enum","values":["1","1/2"],"default":"1"},"mode":{"type":"enum","values":["view","auto","edit","create"],"default":"auto"},"panel-width":{"type":"string","default":""},"personal-layer-text":{"type":"string","default-from":"runtime.personal-layer-text"},"rare-text":{"type":"string","default-from":"runtime.rare-text"},"record-id":{"type":"id","default":""},"remove-field-text":{"type":"string","default-from":"runtime.remove-field-text"},"remove-group-text":{"type":"string","default-from":"runtime.remove-group-text"},"remove-section-text":{"type":"string","default-from":"runtime.remove-section-text"},"rename-text":{"type":"string","default-from":"runtime.rename-text"},"reset-view-ask-text":{"type":"string","default-from":"runtime.reset-view-ask-text"},"reset-view-text":{"type":"string","default-from":"runtime.reset-view-text"},"save-name-text":{"type":"string","default-from":"runtime.save-name-text"},"save-text":{"type":"string","default-from":"runtime.save-text"},"section-icon-text":{"type":"string","default-from":"runtime.section-icon-text"},"section-icons":{"type":"string","default":""},"sections-as":{"type":"enum","values":["list","tabs"],"default":"list"},"sections-label":{"type":"string","default-from":"runtime.sections-label"},"shared-layer-text":{"type":"string","default-from":"runtime.shared-layer-text"},"show-rare":{"type":"boolean","default":false},"show-rare-text":{"type":"string","default-from":"runtime.show-rare-text"},"shown-text":{"type":"string","default-from":"runtime.shown-text"},"unplaced-hint-text":{"type":"string","default-from":"runtime.unplaced-hint-text"},"unplaced-title":{"type":"string","default-from":"runtime.unplaced-title"},"variant-text":{"type":"string","default-from":"runtime.variant-text"},"view-conflict-text":{"type":"string","default-from":"runtime.view-conflict-text"},"view-denied-text":{"type":"string","default-from":"runtime.view-denied-text"},"width-text":{"type":"string","default-from":"runtime.width-text"},"view-profile-label":{"type":"string","default-from":"runtime.view-profile-label"},"add-view-text":{"type":"string","default-from":"runtime.add-view-text"},"new-view-text":{"type":"string","default-from":"runtime.new-view-text"},"delete-view-text":{"type":"string","default-from":"runtime.delete-view-text"},"last-shared-view-text":{"type":"string","default-from":"runtime.last-shared-view-text"},"full":{"type":"boolean","default":false},"open":{"type":"boolean","default":true}},"values":{"revision":{"type":"string"},"section":{"type":"string"}},"events":{"close":{"carries":{"reason":{"type":"enum","values":["close","escape","cancelled","deleted","api"]},"record_id":{"type":"id","nullable":true},"unsaved_fields":{"type":"list"}},"cancelable":true},"open-full":{"carries":{"id":"id","address":"string","record_id":{"type":"id","nullable":true}}},"saved":{"carries":{"id":"id","revision":{"type":"string","optional":true}}},"failed":{"carries":{"reason":"string","message":{"type":"string","optional":true}}},"open":{"carries":{"field":"string","value":"object","answer":"string"}},"delete":{"carries":{"collection":"string","revision":"string","answer":"string","record_id":{"type":"id","nullable":true}}},"created":{"carries":{"collection":{"type":"string","nullable":true},"record_id":{"type":"id","nullable":true}}},"cancel":{"carries":{"mode":{"type":"enum","values":["auto","edit","create"]},"scope":{"type":"enum","values":["group"],"optional":true},"section":{"type":"string","optional":true},"group":{"type":"string","optional":true}}},"state":{"carries":{"state":"string","message":"string"},"own-verb":true},"address-copy":{"carries":{},"own-verb":true},"favourite":{"carries":{"collection":{"type":"string","nullable":true},"favourite":"boolean","record_id":{"type":"id","nullable":true}},"own-verb":true}},"actions":{"refresh":{},"load":{"with":{"reason":{"type":"string","optional":true}}},"edit-group":{"with":{"section":"string","group":"string"}},"cancel-edit":{},"save-group":{"with":{"options":{"type":"object","optional":true}},"concurrency":"drop"},"select-section":{"with":{"key":"string"}},"close-panel":{"with":{"reason":{"type":"string","optional":true}}},"copy-address":{},"open-full-page":{},"confirm-save":{},"cancel-confirmation":{}},"port":{"id":"simai.property-view-port","version":"1.17.0","contract":"src/core/contracts/ports/simai.property-view-port/1.17.0/port.json"},"presentation":{"skeleton":{"file":"skeleton.html","late":[]}},"css-variables":{"--sf-property-view--sections-width":{"type":"length","state":"default"},"--sf-property-view--title-size":{"type":"length","state":"default"},"--sf-property-view--label-size":{"type":"length","state":"default"},"--sf-property-view--value-size":{"type":"length","state":"default"},"--sf-property-view--group-size":{"type":"length","state":"default"},"--sf-property-view--edge-room":{"type":"length","state":"open"}},"host-states":{"data-state":"string","aria-busy":"string"}}')},"99fb492b7fba"(e){e.exports=JSON.parse('{"title":"Property view","events":{"state":{"label":"Record state"},"address-copy":{"label":"Address copied"},"favourite":{"label":"Favourite"}},"runtime":{"add-field-text":"Add a field","add-group-text":"Add an area","add-section-text":"Add a section","add-view-text":"Add a view","back-label":"Back","cancel-configuring-text":"Cancel","cancel-name-text":"Leave the name","cancel-text":"Cancel","changed-text":"Fields changed","close-label":"Close","configure-hint-narrow-text":"Drag fields between groups. Applied at once.","configure-hint-text":"Drag fields between groups and onto a section on the left. Applied at once.","configure-text":"Arrange the view","confirm-save-text":"Confirm and save","conflict-text":"The record changed; read it again","copy-link-label":"Copy link","create-text":"Create","delete-text":"Delete","delete-view-text":"Remove the view","done-configuring-text":"Done","edit-text":"edit","empty-record-text":"This record has nothing to show","empty-text":"not filled in","errors-text":"Errors","favourite-label":"Favourite","field-label-text":"Name","field-settings-text":"Field settings","hidden-text":"Hide","hide-rare-text":"Hide rare fields","hint-text":"Hint","in-this-group-text":"In this area","inherited-text":"by default","keep-editing-text":"Keep editing","last-shared-view-text":"The only view everyone has","link-copied-label":"Link copied","menu-label":"More","move-down-text":"Move down","move-up-text":"Move up","new-group-title":"New area","new-section-title":"New section","new-view-text":"New view","no-match-text":"Nothing matches","open-full-label":"Open as a page","personal-layer-text":"Personal","rare-text":"rare","read-only-text":"You can only view this record","remove-field-text":"Remove from this area","remove-group-text":"Remove this area","remove-section-text":"Remove this section","rename-text":"Rename","reset-view-ask-text":"Reset the whole view?","reset-view-text":"Reset","save-failed-text":"The save failed","save-name-text":"Save the name","save-text":"Save","section-icon-text":"Section glyph","sections-label":"Sections","shared-layer-text":"Everyone\'s","show-rare-text":"Show rare fields","shown-text":"Shown","state-load-failed":"The record could not be read","state-loading":"Reading the record","state-port-not-connected":"The record port is not connected","state-unavailable":"The record is unavailable","unplaced-hint-text":"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out.","unplaced-title":"Not placed","variant-text":"Template","view-conflict-text":"The view changed and was read again","view-denied-text":"You may not change this layer","view-profile-label":"View","view-reset-failed-text":"The view could not be reset","view-save-failed-text":"The view could not be saved","width-text":"Full width"}}')},d614908e644f(e){e.exports=JSON.parse('{"title":"Запись","events":{"state":{"label":"Состояние записи"},"address-copy":{"label":"Адрес скопирован"},"favourite":{"label":"Избранное"}},"runtime":{"add-field-text":"Добавить поле","add-group-text":"Добавить область","add-section-text":"Добавить раздел","add-view-text":"Добавить вид","back-label":"Назад","cancel-configuring-text":"Отменить","cancel-name-text":"Оставить название","cancel-text":"Отменить","changed-text":"Изменено полей","close-label":"Закрыть","configure-hint-narrow-text":"Перетаскивайте поля между группами. Применяется сразу.","configure-hint-text":"Перетаскивайте поля между группами и на разделы слева. Применяется сразу.","configure-text":"Настроить вид","confirm-save-text":"Подтвердить и сохранить","conflict-text":"Запись изменилась, обновите её","copy-link-label":"Копировать ссылку","create-text":"Создать","delete-text":"Удалить","delete-view-text":"Удалить вид","done-configuring-text":"Готово","edit-text":"изменить","empty-record-text":"В этой записи нечего показать","empty-text":"не заполнено","errors-text":"Ошибок","favourite-label":"В избранное","field-label-text":"Название","field-settings-text":"Настройки поля","hidden-text":"Скрыть","hide-rare-text":"Скрыть редкие поля","hint-text":"Подсказка","in-this-group-text":"В этой области","inherited-text":"по умолчанию","keep-editing-text":"Вернуться к правке","last-shared-view-text":"Единственный общий вид","link-copied-label":"Ссылка скопирована","menu-label":"Ещё","move-down-text":"Ниже","move-up-text":"Выше","new-group-title":"Новая область","new-section-title":"Новый раздел","new-view-text":"Новый вид","no-match-text":"Ничего не найдено","open-full-label":"Открыть на всю страницу","personal-layer-text":"Персональный","rare-text":"редкое","read-only-text":"Эту запись можно только смотреть","remove-field-text":"Убрать из области","remove-group-text":"Удалить область","remove-section-text":"Удалить раздел","rename-text":"Переименовать","reset-view-ask-text":"Сбросить весь вид?","reset-view-text":"Сбросить","save-failed-text":"Не удалось сохранить","save-name-text":"Сохранить название","save-text":"Сохранить","section-icon-text":"Значок раздела","sections-label":"Разделы","shared-layer-text":"Для всех","show-rare-text":"Показать редкие поля","shown-text":"Показывать","state-load-failed":"Не удалось загрузить запись","state-loading":"Загрузка записи","state-port-not-connected":"Порт записи не подключён","state-unavailable":"Запись недоступна","unplaced-hint-text":"Поля, которых нет в этом виде. Перетащите поле в группу, чтобы разместить, или сюда, чтобы убрать.","unplaced-title":"Не размещённые","variant-text":"Вид","view-conflict-text":"Вид изменился, он перезагружен","view-denied-text":"Нет права менять этот слой","view-profile-label":"Вид","view-reset-failed-text":"Не удалось сбросить вид","view-save-failed-text":"Не удалось сохранить вид","width-text":"На всю ширину"}}')}};const t={};function n(i){const r=t[i];if(void 0!==r)return r.exports;const s=t[i]={exports:{}};return e[i](s,s.exports,n),s.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",i=e?Symbol("webpack exports"):"__webpack_exports__",r=e?Symbol("webpack error"):"__webpack_error__",s=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};n.a=(e,n,o)=>{let a;o&&((a=[]).d=-1);const l=new Set,c=e.exports;let u,d,p;const h=new Promise((e,t)=>{p=t,d=e});h[i]=c,h[t]=e=>(a&&e(a),l.forEach(e),h.catch(e=>{})),e.exports=h;n(e=>{let n;u=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const n=[];n.d=0,e.then(e=>{o[i]=e,s(n)},e=>{o[r]=e,s(n)});const o={};return o[t]=e=>e(n),o}}const n={};return n[t]=e=>{},n[i]=e,n}))(e);const o=()=>u.map(e=>{if(e[r])throw e[r];return e[i]}),c=new Promise(e=>{n=()=>e(o),n.r=0;const i=e=>e!==a&&!l.has(e)&&(l.add(e),e&&!e.d&&(n.r++,e.push(n)));u.map(e=>e[t](i))});return n.r?c:o()},e=>(e?p(h[r]=e):d(c),s(a))),a?.d<0&&(a.d=0)}})(),n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var r=t[i++],s=t[i++];n.o(e,r)?0===s&&i++:0===s?Object.defineProperty(e,r,{enumerable:!0,value:t[i++]}):Object.defineProperty(e,r,{enumerable:!0,get:s})}else for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);n("7623a90f1816")})();