@simai-studio/view 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +5 -5
  2. package/dist/package-receipt.json +356 -114
  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 +10 -2
  7. package/dist/smart/view/component.json.gz +0 -0
  8. package/dist/smart/view/js/view.js +23 -6
  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 +10 -3
  13. package/dist/smart/view/smart.manifest.json.gz +0 -0
  14. package/dist/smart/view/static/default/open-record.html +12 -17
  15. package/dist/smart/view/static/default/open-record.html.gz +0 -0
  16. package/dist/smart/view/static/default/reference.html +12 -17
  17. package/dist/smart/view/static/default/reference.html.gz +0 -0
  18. package/dist/smart/view-flow/component.json +612 -0
  19. package/dist/smart/view-flow/component.json.gz +0 -0
  20. package/dist/smart/view-flow/css/view-flow.css +203 -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 +2 -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 +5858 -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 +638 -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 +478 -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 +10 -2
  57. package/dist/smart/view-properties/component.json.gz +0 -0
  58. package/dist/smart/view-properties/css/view-properties.css +24 -19
  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 -1
  61. package/dist/smart/view-properties/css/view-properties.min.css.gz +0 -0
  62. package/dist/smart/view-properties/js/view-properties.js +358 -185
  63. package/dist/smart/view-properties/js/view-properties.js.gz +0 -0
  64. package/dist/smart/view-properties/js/view-properties.min.js +94 -121
  65. package/dist/smart/view-properties/js/view-properties.min.js.gz +0 -0
  66. package/dist/smart/view-properties/lang/en.json +0 -7
  67. package/dist/smart/view-properties/lang/en.json.gz +0 -0
  68. package/dist/smart/view-properties/lang/ru.json +0 -7
  69. package/dist/smart/view-properties/lang/ru.json.gz +0 -0
  70. package/dist/smart/view-properties/smart.manifest.json +16 -9
  71. package/dist/smart/view-properties/smart.manifest.json.gz +0 -0
  72. package/dist/smart/view-properties/template/default.css +22 -19
  73. package/dist/smart/view-properties/template/default.css.gz +0 -0
  74. package/dist/smart/view-properties/template/default.js +1 -79
  75. package/dist/smart/view-properties/template/default.js.gz +0 -0
  76. package/dist/smart/view-table/component.json +10 -2
  77. package/dist/smart/view-table/component.json.gz +0 -0
  78. package/dist/smart/view-table/js/view-table.js +377 -88
  79. package/dist/smart/view-table/js/view-table.js.gz +0 -0
  80. package/dist/smart/view-table/js/view-table.min.js +58 -56
  81. package/dist/smart/view-table/js/view-table.min.js.gz +0 -0
  82. package/dist/smart/view-table/smart.manifest.json +11 -4
  83. package/dist/smart/view-table/smart.manifest.json.gz +0 -0
  84. package/dist/smart/view-table/template/default.js +1 -1
  85. package/dist/smart/view-table/template/default.js.gz +0 -0
  86. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- (()=>{"use strict";var e={"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:()=>I,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 L(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 V=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="${V(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 R=e=>{const t=e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;return"string"==typeof t?t:""};function I(e){const t=R(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(L(r,{mode:t}))}(t,{mode:"value"}):""}function M(e){const t=R(e);return t?function(e){const t=L(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,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`
2
2
  <sf-input
3
3
  size=${h(t)}
4
4
  appearance="filled"
@@ -169,7 +169,7 @@
169
169
  label=${e.label||e.key||""}
170
170
  @change=${t=>i.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 L(e,t){if(!Array.isArray(t)||!t.length)return null;if("badges"===String(e.variant??""))return V(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 V(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:I,datetime:I,time:I,boolean:D,choices:L,file:E,color:F,include:le,choice:R,integer:M,number:M,user:j,record:N,relation:N,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 R(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 I(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)}}}:I(e,t,i)}function U(e){return{component:{type:"reference-link",props:{line:T,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:T,text:t.avatarText||""}}},t.href?U(t):String(t.label)]:null}function N(e,t){return t&&"object"==typeof t&&t.label?U(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:Re,string:ce,text:de,html:pe,integer:me,number:me,date:ye,datetime:xe,time:$e,boolean:Se,choice:Ce,choices:qe,file:je,color:z,include:ae};function J(e){return`sf_field_${e.key||"value"}`}function X(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: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`
173
173
  <sf-input-country
174
174
  size=${W}
175
175
  name=${J(e)}
@@ -181,7 +181,7 @@
181
181
  show-code="true"
182
182
  @change=${t=>i.setFieldValue(e,t.detail?.value??t.target?.value??"")}
183
183
  ></sf-input-country>
184
- `}function Y(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,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`
185
185
  <span class="sf-field-password flex items-cross-center gap-1/3 min-w-0" spellcheck="false">
186
186
  <sf-input
187
187
  size=${W}
@@ -206,7 +206,7 @@
206
206
  @click=${ee}
207
207
  ></sf-button-icon>
208
208
  </span>
209
- `}function ie(e,t,i){return Y(e)?Q(i,t):null}function re(e,t,i){return Y(e)?n.html`<span class="sf-field-view">${Q(i,t)}</span>`:Ye(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`
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
210
  <pre class="sf-field-include" data-language=${e.language?String(e.language):n.nothing}><code>${String(i)}</code></pre>
211
211
  `:n.nothing}function ae(e,t,i){return n.html`
212
212
  <sf-input-textarea
@@ -223,7 +223,7 @@
223
223
  @change=${t=>i.setFieldValue(e,t.target?.value??"")}
224
224
  @input=${t=>i.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??"")?X(e,t,i):Y(e)?te(e,t,i):r?ue(e,t,i,r):(t=Je(t),n.html`
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`
227
227
  <sf-input
228
228
  size=${W}
229
229
  appearance="bordered"
@@ -380,6 +380,7 @@
380
380
  name=${J(e)}
381
381
  ?required=${Boolean(e.required)}
382
382
  value=${t??""}
383
+ placeholder=${e.placeholder||n.nothing}
383
384
  aria-label=${e.label||e.key||""}
384
385
  .options=${Te(e,t,!1)}
385
386
  @change=${t=>i.setFieldValue(e,t.detail?.value??null)}
@@ -402,11 +403,12 @@
402
403
  search="false"
403
404
  name=${J(e)}
404
405
  ?required=${Boolean(e.required)}
406
+ placeholder=${e.placeholder||n.nothing}
405
407
  aria-label=${e.label||e.key||""}
406
408
  .options=${Te(e,t,!0)}
407
409
  @change=${t=>{const r=t.detail?.values??t.detail?.value;i.setFieldValue(e,Array.isArray(r)?r:r?[r]:[])}}
408
410
  ></sf-dropdown>
409
- `}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:"Заполните поле полностью"}},Ve="sf-field-renderers";function Pe(e,t){return e?.getFieldText?.(t)??(0,a.pageText)(Le,t,e??null,Ve)}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`
411
+ `}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
412
  <div class="sf-field-picker flex flex-col gap-1/3" data-field-picker=${e.key||n.nothing}>
411
413
  <sf-dropdown
412
414
  size=${W}
@@ -442,7 +444,7 @@
442
444
  </div>
443
445
  `:n.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 Re(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`
447
+ `}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
448
  <div class="sf-field-picker flex flex-col gap-1/3" data-field-picker=${e.key||n.nothing}>
447
449
  <sf-dropdown
448
450
  size=${W}
@@ -479,7 +481,7 @@
479
481
  </div>
480
482
  `:n.nothing}
481
483
  </div>
482
- `}function Ie(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&&Ie(t).length<=1}function Ue(e,t,i){const r=Ie(t)[0]??null,s=Array.isArray(t);return n.html`
484
+ `}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`
483
485
  <sf-input-image
484
486
  size=${W}
485
487
  name=${J(e)}
@@ -491,7 +493,7 @@
491
493
  ?disabled=${!0===e.readonly}
492
494
  @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}])}}
493
495
  ></sf-input-image>
494
- `}function je(e,t,i){if(Me(e,t))return Ue(e,t,i);const r=Ie(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 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`
495
497
  <div class="sf-field-file flex flex-col">
496
498
  ${r.map((t,o)=>n.html`
497
499
  <sf-file-preview
@@ -525,7 +527,7 @@
525
527
  ></sf-file-upload>
526
528
  `:n.nothing}
527
529
  </div>
528
- `}const Ne=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=Ne(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 Xe(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 Ye(e,t,i){const r=Xe(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=Xe(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=Xe(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 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`
529
531
  <sf-badge
530
532
  line=${We}
531
533
  appearance=${e.badgeAppearance??k}
@@ -555,7 +557,7 @@
555
557
  <span class="sf-field-view flex flex-wrap items-cross-center gap-1/3 min-w-0">
556
558
  ${i.map(e=>n.html`<sf-tag root-class="flex-none" line=${We} kind="default" text=${e.label}></sf-tag>`)}
557
559
  </span>
558
- `:n.nothing}function at(e,t){const i=Ie(t);if(!i.length)return n.nothing;const r=se(e),s="image-card"===String(e.variant??"");return n.html`
560
+ `: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`
559
561
  <span class="sf-field-view flex ${s?"flex-row":"flex-col"} gap-1/3">
560
562
  ${i.map(e=>n.html`
561
563
  <sf-file-preview
@@ -571,39 +573,10 @@
571
573
  ></sf-file-preview>
572
574
  `)}
573
575
  </span>
574
- `}const lt={string:re,text:Ye,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=Ne(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("9ce1a42b2a85"),g=i("844bdc4d24eb"),m=e([r,n,d,p,h]);[r,n,d,p,h]=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])),L={en:q(l.runtime),ru:q(c.runtime)},V=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.inputDrafts=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 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)(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 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)(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 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)(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: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)(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,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,g.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,g.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,g.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)))}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,hostPort:this.hostPort,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,dateTimeText:{dateLabel:(0,d.pageText)(L,"dateTimeDateLabel",this),timeLabel:(0,d.pageText)(L,"dateTimeTimeLabel",this),placeholder:(0,d.pageText)(L,"timePlaceholderText",this)},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)(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 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)(L,"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)(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,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)(L,"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??"");return void 0===t?this.changed.delete(i):this.changed.set(i,t),this.errors.delete(i),this.confirmation=null,this.requestComponentUpdate("changed"),this}dateTimeDraft(e){return this.inputDrafts.get(String(e))??null}changeDateTime(e,t,i,r){const n=String(e.key??""),s=(0,f.AC)(e.value),o=this.inputDrafts.get(n)??(0,f.AC)(t),a=String(r??""),l={...o,[i]:"time"===i?(0,f.d2)(a)??a:a};this.inputDrafts.set(n,l);const c=(0,f.cy)(s,l);if(c.error)return this.changed.delete(n),this.errors.delete(n),this.inputErrors.set(n,(0,d.pageText)(L,`${c.error}Text`,this)),this.requestComponentUpdate("errors"),this;this.inputErrors.delete(n);const u=null===c.value?s.known&&!s.date:c.value===s.raw;return this.changeField(e,u?void 0:c.value)}_clearInputs(){this.inputDrafts.clear(),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,g.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)(L,"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)(L,"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):V}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)(L,"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)(L,"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}}},d577a2a824ab(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{u:()=>l});var n=i("2a080a730149"),s=i("9ce1a42b2a85"),o=e([n]),a=o.then?(await o)():o;n=a[0];function l(e,t,i){const r=String(t.key??""),o=(0,s.AC)(i),a=e.component.dateTimeDraft(r)??o,l=String(t.label||t.key||""),c=e.dateTimeText,u="1/2"===e.size?"1/2":"1",d=`sf_field_${t.key||"value"}`,p=e.errors.has(r),h=(r,n)=>e.component.changeDateTime(t,i,r,n);return n.html`
575
- <div class="sf-property-view-datetime" role="group" aria-label=${l} data-datetime=${r}>
576
- <sf-input-date
577
- class="sf-property-view-datetime-date"
578
- size=${u}
579
- name=${`${d}_date`}
580
- .value=${a.date}
581
- aria-label=${c.dateLabel.replace("{label}",l)}
582
- ?required=${Boolean(t.required)}
583
- @change=${e=>{e.target===e.currentTarget&&h("date",e.detail?.value??e.currentTarget?.value??"")}}
584
- ></sf-input-date>
585
- <sf-input
586
- class="sf-property-view-datetime-time"
587
- size=${u}
588
- appearance="bordered"
589
- root-class="sf-property-view-datetime-time-field"
590
- name=${`${d}_time`}
591
- value=${a.time}
592
- inputmode="numeric"
593
- autocomplete="off"
594
- placeholder=${c.placeholder}
595
- mask
596
- mask-pattern="00:00"
597
- ?invalid=${p}
598
- ?required=${Boolean(t.required)}
599
- aria-label=${c.timeLabel.replace("{label}",l)}
600
- @change=${e=>h("time",e.currentTarget?.value??"")}
601
- ></sf-input>
602
- </div>
603
- `}r()}catch(c){r(c)}})},"40b137e60526"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{$:()=>Z});var n=i("2a080a730149"),s=i("e5483002f3ea"),o=i("d577a2a824ab"),a=e([n,s,o]);[n,s,o]=a.then?(await a)():a;function l(e,t,i,{disabled:r=!1}={}){const a=String(t.key??""),l={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)}:{}},c=t.propertyType||t.type||t.dataType,u=i&&"datetime"===c&&!0!==t.readonly?(0,o.u)(e,t,e.changed.has(a)?e.changed.get(a):t.value):i?(0,s.z4)(t,e.changed.has(a)?e.changed.get(a):t.value,l,{size:e.size,...r?{disabled:!0}:{}}):(0,s.oX)(t,t.value,e.hostPort,{size:e.size}),d=["record","relation","user"].includes(t.propertyType||t.type)&&t.value&&"object"==typeof t.value;if(!i&&d&&u)return n.html`<span
576
+ `}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}}},"62c5c417c97d"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{G:()=>a});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
604
577
  class="sf-property-view-reference"
605
578
  @click=${i=>{i.preventDefault(),i.stopPropagation(),e.component.openReference(t,t.value)}}
606
- >${u}</span>`;if(i&&(null==u||u===n.nothing)){const i=(0,s.oX)(t,t.value,e.hostPort,{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==u||u===n.nothing?n.html`<span class="sf-property-view-empty color-on-surface-variant">${e.emptyText}</span>`:u}function c(e,t){return e.configuring?t??[]:e.visible(t)}function u(e){if(!e.canConfigureView)return n.nothing;if(!e.configuring)return n.nothing;const t=e.editableLayers??[],i=n.html`
579
+ >${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}r()}catch(l){r(l)}})},"40b137e60526"(e,t,i){i.a(e,async(e,r)=>{try{i.d(t,{$:()=>X});var n=i("2a080a730149"),s=i("e5483002f3ea"),o=i("62c5c417c97d"),a=e([n,s,o]);[n,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 n.nothing;if(!e.configuring)return n.nothing;const t=e.editableLayers??[],i=n.html`
607
580
  <sf-profile-picker
608
581
  size=${e.size}
609
582
  data-action="view-profile"
@@ -664,7 +637,7 @@
664
637
  @click=${()=>e.component.stopConfiguringView()}
665
638
  ></sf-button>`}
666
639
  </div>
667
- `}function d(e,t,i){const r=Array.isArray(t.variantOptions)?t.variantOptions:[];return n.html`
640
+ `}function u(e,t,i){const r=Array.isArray(t.variantOptions)?t.variantOptions:[];return n.html`
668
641
  <sf-popover placement="bottom-end" width="16rem" label=${e.fieldSettingsText}
669
642
  data-settings-for=${i}>
670
643
  <sf-button-icon
@@ -728,7 +701,7 @@
728
701
  </label>
729
702
  </div>
730
703
  </sf-popover>
731
- `}function p(e,t,i){const r=!e.canChangeVisibility(t);return n.html`
704
+ `}function d(e,t,i){const r=!e.canChangeVisibility(t);return n.html`
732
705
  <div class="sf-property-view-field-actions flex items-cross-center gap-1/4">
733
706
  <sf-button-icon
734
707
  size="1/2"
@@ -741,9 +714,9 @@
741
714
  aria-label=${e.removeFieldText}
742
715
  @click=${()=>e.component.moveFieldToUnplaced(i)}
743
716
  ></sf-button-icon>
744
- ${d(e,t,i)}
717
+ ${u(e,t,i)}
745
718
  </div>
746
- `}function h(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`
719
+ `}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`
747
720
  <h3 class=${s}>
748
721
  <button type="button" class="sf-property-view-rename-trigger text-start cursor-pointer"
749
722
  data-action="rename"
@@ -795,16 +768,16 @@
795
768
  @click=${()=>e.component.cancelRenaming()}
796
769
  ></sf-button-icon>
797
770
  </span>
798
- `}const f='a[href], button, input, select, textarea, [role="button"], [role="link"]';function g(e,t,i,r="",s=""){const o=!e.configuring&&Boolean(t.when)&&e.fieldDisabled(t);!e.configuring&&t.when&&(t=e.conditionedField(t));const a=String(t.key??""),c=e.controlErrors?.has(a)?null:e.errors.get(a),u=e.configuring?e.entryError("field",a):null;return n.html`
771
+ `}const h='a[href], button, input, select, textarea, [role="button"], [role="link"]';function f(e,t,i,r="",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 n.html`
799
772
  <div class="sf-property-view-field flex flex-col gap-1 min-w-0 ${"full"===t.width?"sf-property-view-field--full":""}"
800
- data-field=${a}
801
- data-sf-sortable-item=${e.configuring?a:n.nothing}
773
+ data-field=${l}
774
+ data-sf-sortable-item=${e.configuring?l:n.nothing}
802
775
  data-arranging=${e.configuring?"true":n.nothing}
803
776
  data-hidden=${e.configuring&&t.hidden?"true":n.nothing}>
804
777
  ${e.configuring?n.html`<i class="sf-icon sf-property-view-grip items-cross-center" data-sf-sortable-handle
805
778
  aria-hidden="true">drag_indicator</i>`:n.nothing}
806
779
  <div class="sf-property-view-field-label flex items-cross-center gap-1/3 color-on-surface-variant">
807
- ${String(t.label??a)}
780
+ ${String(t.label??l)}
808
781
  ${t.required&&i?n.html`<span class="sf-property-view-required color-error" aria-hidden="true">*</span>`:n.nothing}
809
782
  ${t.hint?n.html`<sf-help-mark class="sf-property-view-hint"
810
783
  label=${String(t.hint)}
@@ -812,21 +785,21 @@
812
785
  ${t.rare?n.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:n.nothing}
813
786
  ${t.inherited&&!i?n.html`<span class="sf-property-view-inherited color-on-surface-variant">${e.inheritedText}</span>`:n.nothing}
814
787
  </div>
815
- ${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">${l(e,t,i,{disabled:o})}</div>`:n.html`
788
+ ${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">${(0,o.G)(e,t,i,{disabled:a})}</div>`:n.html`
816
789
  <button
817
790
  type="button"
818
791
  class="sf-property-view-field-value sf-property-view-field-open min-w-0 flex items-cross-center gap-1 text-start cursor-pointer"
819
792
  data-open-group=${s}
820
793
  title=${e.editText}
821
- @click=${t=>{const i=t.composedPath();i.slice(0,Math.max(0,i.indexOf(t.currentTarget))).some(e=>e.matches?.(f))||e.component.editGroup(r,s)}}
794
+ @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)}}
822
795
  >
823
- ${l(e,t,i)}
796
+ ${(0,o.G)(e,t,i)}
824
797
  <i class="sf-icon sf-icon--size-1/2 sf-property-view-pen" aria-hidden="true">edit</i>
825
798
  </button>`}
826
- ${e.configuring?p(e,t,a):n.nothing}
799
+ ${e.configuring?d(e,t,l):n.nothing}
827
800
  ${c||u?n.html`<div class="sf-property-view-field-error color-error" role="alert">${c||u}</div>`:n.nothing}
828
801
  </div>
829
- `}function m(e,t,i){return n.html`
802
+ `}function g(e,t,i){return n.html`
830
803
  <sf-view
831
804
  class="sf-property-view-related"
832
805
  chrome=""
@@ -842,7 +815,7 @@
842
815
  aria-label=${String(t.label??i)}
843
816
  ></sf-view-table>
844
817
  </sf-view>
845
- `}function v(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`
818
+ `}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`
846
819
  <sf-dropdown
847
820
  class="sf-property-view-add"
848
821
  size="1/2"
@@ -866,22 +839,22 @@
866
839
  aria-label=${e.addFieldText}
867
840
  ></sf-button-icon>
868
841
  </sf-dropdown>
869
- `}function b(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=c(e,i.fields),a=e.configuring,l=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,p=d>0||Boolean(e.component.isGroupReading?.(r)),f=d>0?n.html`${Array.from({length:d},(e,t)=>n.html`<div class="sf-skeleton sf-skeleton--animation-pulse" aria-hidden="true">
870
- <div class="sf-skeleton-text sf-skeleton-text--size-1 ${H[t%H.length]}"></div></div>`)}`:n.html`${o.map(i=>g(e,i,s,String(t.key??""),r))}`;return n.html`
842
+ `}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">
843
+ <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`
871
844
  <section class="sf-property-view-group bg-surface-0 flex flex-col gap-2 ${s?"sf-property-view-group--editing":""}"
872
845
  data-group=${r}
873
- aria-busy=${p?"true":n.nothing}
846
+ aria-busy=${h?"true":n.nothing}
874
847
  data-sf-sortable-item=${a?r:n.nothing}
875
848
  data-hidden=${a&&i.hidden?"true":n.nothing}
876
849
  data-columns=${2===i.columns?"2":"1"}>
877
850
  <header class="sf-property-view-group-header flex items-cross-center justify-between gap-2">
878
851
  ${a?n.html`<i class="sf-icon sf-property-view-grip items-cross-center" data-sf-sortable-handle
879
852
  aria-hidden="true">drag_indicator</i>`:n.nothing}
880
- ${h(e,"group",r,String(i.label??r),"sf-property-view-group-title")}
853
+ ${p(e,"group",r,String(i.label??r),"sf-property-view-group-title")}
881
854
  ${i.rare?n.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:n.nothing}
882
855
  ${a?n.html`
883
856
  <span class="flex items-cross-center gap-1/4">
884
- ${v(e,r)}
857
+ ${m(e,r)}
885
858
  <sf-button-icon
886
859
  size="1/2"
887
860
  appearance="link"
@@ -925,17 +898,17 @@
925
898
  @click=${()=>e.component.editGroup(String(t.key??""),r)}
926
899
  ></sf-button>`}
927
900
  </header>
928
- ${l?n.html`<div class="sf-property-view-group-error" role="alert">${l}</div>`:n.nothing}
929
- ${"related"===i.kind?n.html`<div class="sf-property-view-group-related">${m(e,i,r)}</div>`:a?n.html`
901
+ ${c?n.html`<div class="sf-property-view-group-error" role="alert">${c}</div>`:n.nothing}
902
+ ${"related"===i.kind?n.html`<div class="sf-property-view-group-related">${g(e,i,r)}</div>`:a?n.html`
930
903
  <sf-sortable
931
904
  class="sf-property-view-group-fields min-w-0"
932
905
  group="field"
933
906
  accepts="field"
934
907
  id=${`field:${r}`}
935
908
  label=${String(i.label??r)}
936
- >${f}</sf-sortable>`:n.html`<div class="sf-property-view-group-fields min-w-0">${f}</div>`}
909
+ >${v}</sf-sortable>`:n.html`<div class="sf-property-view-group-fields min-w-0">${v}</div>`}
937
910
  </section>
938
- `}function y(e,t){return n.html`
911
+ `}function b(e,t){return n.html`
939
912
  <nav class="sf-property-view-phone-sections flex flex-col" aria-label=${e.sectionsLabel}>
940
913
  ${t.map(t=>n.html`
941
914
  <button
@@ -949,7 +922,7 @@
949
922
  </button>
950
923
  `)}
951
924
  </nav>
952
- `}function w(e){return n.html`
925
+ `}function y(e){return n.html`
953
926
  <div class="sf-property-view-phone-head flex items-cross-center gap-2">
954
927
  <sf-button-icon
955
928
  size=${e.size}
@@ -961,19 +934,19 @@
961
934
  ></sf-button-icon>
962
935
  <h2 class="sf-property-view-phone-title">${e.phoneSectionLabel}</h2>
963
936
  </div>
964
- `}function x(e,t){return t.length<2&&!e.configuring?n.nothing:n.html`
937
+ `}function w(e,t){return t.length<2&&!e.configuring?n.nothing:n.html`
965
938
  <nav class="sf-property-view-sections self-cross-stretch flex flex-col min-w-0" aria-label=${e.sectionsLabel}>
966
939
  ${e.configuring?n.html`
967
- ${S(e,t)}
968
- <div class="sf-property-view-additions flex">${B(e)}</div>`:$(e,t)}
940
+ ${$(e,t)}
941
+ <div class="sf-property-view-additions flex">${j(e)}</div>`:x(e,t)}
969
942
  </nav>
970
- `}function $(e,t){const i=t.map(t=>({label:T(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`
943
+ `}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`
971
944
  <sf-tree
972
945
  selection="one"
973
946
  .items=${i}
974
947
  @sf-tree-select=${t=>{const i=t.detail?.id;i&&e.component.selectSection(String(i))}}
975
948
  ></sf-tree>
976
- `}function S(e,t){return n.html`
949
+ `}function $(e,t){return n.html`
977
950
  <sf-sortable
978
951
  class="sf-property-view-section-tabs flex flex-col"
979
952
  group="section"
@@ -993,20 +966,20 @@
993
966
  <i class="sf-icon sf-property-view-section-grip color-on-surface-variant" data-sf-sortable-handle
994
967
  aria-hidden="true">drag_indicator</i>
995
968
  <i class="sf-icon" aria-hidden="true">${t.icon?String(t.icon):"folder"}</i>
996
- <span class="sf-property-view-section-tab-label flex-auto min-w-0">${T(e,t)}</span>
969
+ <span class="sf-property-view-section-tab-label flex-auto min-w-0">${S(e,t)}</span>
997
970
  </button>
998
971
  `)}
999
972
  </sf-sortable>
1000
- `}function T(e,t){const i=String(t.label??t.key);return t.rare?`${i} · ${e.rareText}`:i}function k(e,t){return T(e,t).replace(/\|/gu,"│").replace(/::/gu,":∶")}function _(e,t){const i=Math.max(0,t.findIndex(t=>String(t.key)===e.selectedSection));return n.html`
973
+ `}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`
1001
974
  <sf-tabs
1002
975
  class="sf-property-view-tabs"
1003
976
  size=${e.size}
1004
977
  active-index=${String(i)}
1005
978
  aria-label=${e.sectionsLabel}
1006
- items=${t.map(t=>k(e,t)).join("|")}
979
+ items=${t.map(t=>T(e,t)).join("|")}
1007
980
  @sf-tabs-change=${i=>{const r=t[Number(i.detail?.current)];r&&e.component.selectSection(String(r.key))}}
1008
981
  ></sf-tabs>
1009
- `}function A(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 F(e){return n.html`
982
+ `}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`
1010
983
  <div class="sf-property-view-actions flex items-cross-center gap-2 flex-wrap" role="group"
1011
984
  data-confirming="true">
1012
985
  <span class="sf-property-view-confirm-text" role="alert">${e.confirmation.text}</span>
@@ -1026,7 +999,7 @@
1026
999
  @click=${()=>e.component.cancelConfirmation()}
1027
1000
  ></sf-button>
1028
1001
  </div>
1029
- `}function C(e){if(e.confirmation)return F(e);const t="create"===e.mode;return n.html`
1002
+ `}function F(e){if(e.confirmation)return A(e);const t="create"===e.mode;return n.html`
1030
1003
  <div class="sf-property-view-actions flex items-cross-center gap-2 flex-wrap" role="group">
1031
1004
  <sf-button
1032
1005
  appearance="default"
@@ -1046,7 +1019,7 @@
1046
1019
  ${e.errors.size?n.html`<span class="sf-property-view-errors color-error">${e.errorsText}: ${e.errors.size}</span>`:n.nothing}
1047
1020
  ${e.conflict?n.html`<span class="sf-property-view-conflict color-error" role="alert">${e.conflict}</span>`:n.nothing}
1048
1021
  </div>
1049
- `}function z(e,{panel:t=!1}={}){if("view"===e.mode)return n.nothing;if(e.openAll)return C(e);const i="create"!==e.mode&&e.recordActions.includes("record.delete");if(e.configuring)return u(e);if(e.editing&&e.confirmation)return F(e);const r=t&&e.hasHostSlot("footer");return e.editing||i||r?n.html`
1022
+ `}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`
1050
1023
  <div class="sf-property-view-actions flex items-cross-center gap-2 flex-wrap" role="group">
1051
1024
  ${e.editing?n.html`
1052
1025
  <sf-button
@@ -1080,7 +1053,7 @@
1080
1053
  @click=${()=>e.component.deleteRecord()}
1081
1054
  ></sf-button-icon>`:n.nothing}
1082
1055
  </div>
1083
- `:n.nothing}function E(e,t){const i=String(t.key??"");return n.html`
1056
+ `:n.nothing}function z(e,t){const i=String(t.key??"");return n.html`
1084
1057
  <div class="sf-property-view-field sf-property-view-field--unplaced flex flex-col gap-1 min-w-0"
1085
1058
  data-field=${i}
1086
1059
  data-sf-sortable-item=${i}
@@ -1091,7 +1064,7 @@
1091
1064
  ${t.rare?n.html`<span class="sf-property-view-rare color-on-surface-variant">${e.rareText}</span>`:n.nothing}
1092
1065
  </div>
1093
1066
  </div>
1094
- `}function q(e){if(!e.configuring)return n.nothing;const t=e.unplaced;return n.html`
1067
+ `}function E(e){if(!e.configuring)return n.nothing;const t=e.unplaced;return n.html`
1095
1068
  <article
1096
1069
  class="sf-accordion sf-accordion--outline sf-property-view-group--unplaced"
1097
1070
  data-unplaced="true"
@@ -1122,10 +1095,10 @@
1122
1095
  accepts="field"
1123
1096
  id=${`unplaced:${e.recordId||"record"}`}
1124
1097
  label=${e.unplacedTitle}
1125
- >${t.map(t=>E(e,t))}</sf-sortable>
1098
+ >${t.map(t=>z(e,t))}</sf-sortable>
1126
1099
  </div>
1127
1100
  </article>
1128
- `}function L(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`
1101
+ `}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`
1129
1102
  <sf-button-icon
1130
1103
  appearance="link"
1131
1104
  scheme="on-surface"
@@ -1162,16 +1135,16 @@
1162
1135
  ></sf-button-icon>`:n.nothing}
1163
1136
  <span class="grow"></span>
1164
1137
  ${e.hasHostSlot("actions")?e.hostSlot("actions"):n.nothing}
1165
- ${L(e)}
1138
+ ${q(e)}
1166
1139
  </div>
1167
1140
  </header>
1168
- `}const P="--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 O(e){return!e.wide||"full"===e.panelSize}function D(e){return n.html`
1169
- <div class="sf-property-view-edge flex ${O(e)?"flex-row":"flex-col"} gap-1/2" slot="edge"
1141
+ `}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`
1142
+ <div class="sf-property-view-edge flex ${P(e)?"flex-row":"flex-col"} gap-1/2" slot="edge"
1170
1143
  aria-label=${e.closeLabel}>
1171
1144
  <sf-button-icon
1172
1145
  appearance="tonal"
1173
1146
  scheme="on-surface"
1174
- root-style=${P}
1147
+ root-style=${L}
1175
1148
  size=${e.size}
1176
1149
  icon="close"
1177
1150
  data-action="close"
@@ -1182,7 +1155,7 @@
1182
1155
  ${e.address?n.html`
1183
1156
  <sf-button-copy
1184
1157
  appearance="tonal"
1185
- root-style=${P}
1158
+ root-style=${L}
1186
1159
  size=${e.size}
1187
1160
  icon="link"
1188
1161
  value=${e.addressUrl}
@@ -1198,7 +1171,7 @@
1198
1171
  <sf-button-icon
1199
1172
  appearance="tonal"
1200
1173
  scheme="on-surface"
1201
- root-style=${P}
1174
+ root-style=${L}
1202
1175
  size=${e.size}
1203
1176
  icon="open_in_full"
1204
1177
  aria-label=${e.openFullLabel}
@@ -1207,11 +1180,11 @@
1207
1180
  @click=${()=>e.component.openFullPage()}
1208
1181
  ></sf-button-icon>`:n.nothing}
1209
1182
  </div>
1210
- `}function R(e,t){return!e.wide&&t.length>1&&null===e.phoneSection}function I(e,t,i){return t?n.html`
1183
+ `}function D(e,t){return!e.wide&&t.length>1&&null===e.phoneSection}function I(e,t,i){return t?n.html`
1211
1184
  <div class="sf-property-view-section-bar flex items-cross-center gap-1/4"
1212
1185
  data-section=${String(t.key)}>
1213
- ${e.configuring?M(e,t):n.html`<i class="sf-icon" aria-hidden="true">${t.icon?String(t.icon):"folder"}</i>`}
1214
- ${h(e,"section",String(t.key),String(t.label??t.key),"sf-property-view-section-title min-w-0")}
1186
+ ${e.configuring?R(e,t):n.html`<i class="sf-icon" aria-hidden="true">${t.icon?String(t.icon):"folder"}</i>`}
1187
+ ${p(e,"section",String(t.key),String(t.label??t.key),"sf-property-view-section-title min-w-0")}
1215
1188
  <sf-button-icon
1216
1189
  size="1/2"
1217
1190
  appearance="link"
@@ -1224,7 +1197,7 @@
1224
1197
  @click=${()=>e.component.removeSection(String(t.key))}
1225
1198
  ></sf-button-icon>
1226
1199
  </div>
1227
- `:n.nothing}function M(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`
1200
+ `: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`
1228
1201
  <sf-dropdown
1229
1202
  class="sf-property-view-section-icon"
1230
1203
  size="1/2"
@@ -1249,7 +1222,7 @@
1249
1222
  aria-label=${e.sectionIconText}
1250
1223
  ></sf-button-icon>
1251
1224
  </sf-dropdown>
1252
- `}function U(e){const t=e.viewProfiles??[];return t.length?n.html`
1225
+ `}function M(e){const t=e.viewProfiles??[];return t.length?n.html`
1253
1226
  <section class="sf-property-view-profiles flex flex-col gap-1/3">
1254
1227
  <h3 class="sf-property-view-profiles-title">${e.viewProfileLabel}</h3>
1255
1228
  ${t.map(t=>n.html`
@@ -1279,7 +1252,7 @@
1279
1252
  ></sf-button-icon>
1280
1253
  </div>
1281
1254
  `)}
1282
- ${e.namingView?j(e):n.html`
1255
+ ${e.namingView?N(e):n.html`
1283
1256
  <sf-button
1284
1257
  appearance="outline"
1285
1258
  scheme="on-surface"
@@ -1289,7 +1262,7 @@
1289
1262
  @click=${()=>e.component.startNamingView()}
1290
1263
  ></sf-button>`}
1291
1264
  </section>
1292
- `:n.nothing}function j(e){const t=t=>{const i=t.target?.closest?.(".sf-property-view-rename")?.querySelector("sf-input");e.component.createViewProfile(i?.value??"")};return n.html`
1265
+ `: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`
1293
1266
  <span class="sf-property-view-rename flex items-cross-center gap-1/4 min-w-0" data-action="new-profile">
1294
1267
  <sf-input
1295
1268
  size="1/2"
@@ -1322,7 +1295,7 @@
1322
1295
  @click=${()=>e.component.cancelNamingView()}
1323
1296
  ></sf-button-icon>
1324
1297
  </span>
1325
- `}function N(e,t){return n.html`
1298
+ `}function U(e,t){return n.html`
1326
1299
  <div class="sf-property-view-additions flex flex-col items-cross-stretch gap-1">
1327
1300
  <sf-button
1328
1301
  appearance="outline"
@@ -1332,10 +1305,10 @@
1332
1305
  data-action="add-group"
1333
1306
  @click=${()=>e.component.addGroup(t?String(t.key):"")}
1334
1307
  ></sf-button>
1335
- ${G(e)?n.nothing:B(e)}
1336
- ${U(e)}
1308
+ ${B(e)?n.nothing:j(e)}
1309
+ ${M(e)}
1337
1310
  </div>
1338
- `}function B(e){return n.html`
1311
+ `}function j(e){return n.html`
1339
1312
  <sf-button
1340
1313
  appearance="outline"
1341
1314
  scheme="on-surface"
@@ -1344,29 +1317,29 @@
1344
1317
  data-action="add-section"
1345
1318
  @click=${()=>e.component.addSection()}
1346
1319
  ></sf-button>
1347
- `}function G(e){const t=c(e,e.sections);return Boolean(e.wide&&"list"===e.sectionsAs&&(t.length>1||e.configuring))}const H=["w-1/3","w-2/3","w-1/2","w-3/4","w-2/5"],W=3,K=3;function J(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 ${H[e%H.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:W},(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:K},(e,r)=>t(i+r+1))}</section>`)}<span class="sr-only" role="status">${e.message}</span></div>`}function X(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"
1320
+ `}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"
1348
1321
  text=${t.text||n.nothing}
1349
1322
  .actions=${"error"===t.kind?null:[]}
1350
- @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 J(e);if(e.loadFailure)return X(e);const r=c(e,e.sections),s=r.find(t=>String(t.key)===e.selectedSection)??r[0]??null;return n.html`
1323
+ @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`
1351
1324
  <div class="sf-property-view-status" role="status" aria-live="polite" ?hidden=${!e.message}>
1352
1325
  ${e.message}
1353
1326
  </div>
1354
1327
  ${!e.panel&&(e.hasHostSlot("actions")||e.hasHostSlot("menu")||e.panelMenuItems.length)?n.html`
1355
1328
  <div class="sf-property-view-host-actions flex flex-wrap items-cross-center justify-end gap-1">
1356
1329
  ${e.hasHostSlot("actions")?e.hostSlot("actions"):n.nothing}
1357
- ${L(e)}
1330
+ ${q(e)}
1358
1331
  </div>`:n.nothing}
1359
- ${R(e,r)?y(e,r):n.nothing}
1360
- ${e.wide&&"tabs"===e.sectionsAs&&r.length>1?_(e,r):n.nothing}
1332
+ ${D(e,r)?b(e,r):n.nothing}
1333
+ ${e.wide&&"tabs"===e.sectionsAs&&r.length>1?k(e,r):n.nothing}
1361
1334
  <div class="sf-property-view-layout"
1362
- style=${`--sf-property-view--sections-width: ${e.sectionsWidth};${e.panel?"":A(e)}`}
1335
+ style=${`--sf-property-view--sections-width: ${e.sectionsWidth};${e.panel?"":_(e)}`}
1363
1336
  data-sections=${String(r.length)}
1364
- data-screen=${R(e,r)?"sections":"groups"}>
1365
- ${!e.wide&&r.length>1&&null!==e.phoneSection?w(e):n.nothing}
1366
- ${G(e)&&!t?x(e,r):n.nothing}
1337
+ data-screen=${D(e,r)?"sections":"groups"}>
1338
+ ${!e.wide&&r.length>1&&null!==e.phoneSection?y(e):n.nothing}
1339
+ ${B(e)&&!t?w(e,r):n.nothing}
1367
1340
  ${e.isEmptyRecord&&!e.configuring?n.html`<p class="sf-property-view-empty-record color-on-surface-variant"
1368
1341
  role="status">${e.emptyRecordText}</p>`:n.nothing}
1369
- ${R(e,r)?n.nothing:e.configuring?n.html`
1342
+ ${D(e,r)?n.nothing:e.configuring?n.html`
1370
1343
  <div class="sf-property-view-body flex-auto min-w-0 flex flex-col gap-4">
1371
1344
  ${I(e,s,r.length)}
1372
1345
  <sf-sortable
@@ -1375,17 +1348,17 @@
1375
1348
  accepts="group"
1376
1349
  id=${`group:${s?String(s.key):""}`}
1377
1350
  label=${String(s?.label??s?.key??"")}
1378
- >${c(e,s?.groups).map(t=>b(e,s,t))}</sf-sortable>
1379
- ${N(e,s)}
1380
- ${q(e)}
1351
+ >${l(e,s?.groups).map(t=>v(e,s,t))}</sf-sortable>
1352
+ ${U(e,s)}
1353
+ ${E(e)}
1381
1354
  </div>`:n.html`
1382
1355
  <div class="sf-property-view-body flex-auto min-w-0 flex flex-col gap-4">
1383
- ${e.visible(s?.groups).map(t=>b(e,s,t))}
1356
+ ${e.visible(s?.groups).map(t=>v(e,s,t))}
1384
1357
  </div>`}
1385
1358
  </div>
1386
1359
  ${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}
1387
- ${i?z(e):n.nothing}
1388
- `}function Z(e){if(!e.panel)return Y(e);const t=G(e);return n.html`
1360
+ ${i?C(e):n.nothing}
1361
+ `}function X(e){if(!e.panel)return Y(e);const t=B(e);return n.html`
1389
1362
  <sf-drawer
1390
1363
  ?open=${e.panelOpen}
1391
1364
  placement="inline-end"
@@ -1394,15 +1367,15 @@
1394
1367
  size=${e.wide?e.panelSize:"full"}
1395
1368
  width=${e.wide&&e.drawerWidth||n.nothing}
1396
1369
  gutter="var(--sf-space-1)"
1397
- panel-style=${`--sf-drawer-background: var(--sf-surface-1); --sf-property-view--sections-width: ${e.sectionsWidth}; scrollbar-gutter: auto;${A(e)}`}
1370
+ panel-style=${`--sf-drawer-background: var(--sf-surface-1); --sf-property-view--sections-width: ${e.sectionsWidth}; scrollbar-gutter: auto;${_(e)}`}
1398
1371
  show-close="false"
1399
1372
  close-label=${e.closeLabel}
1400
1373
  close-on-esc="false"
1401
1374
  label=${e.panelLabel||e.recordId||""}
1402
1375
  >
1403
- ${D(e)}
1404
- <div class="sf-property-view-panel relative flex flex-col gap-2${t?" sf-property-view-panel--railed":""}${O(e)?" sf-property-view-panel--fills":""}"
1405
- style=${O(e)?`--sf-property-view--edge-room: calc(${e.edgeControlCount} * ${e.edgeControlWidth} + ${e.edgeControlCount-1} * var(--sf-space-1\\/2));`:n.nothing}
1376
+ ${O(e)}
1377
+ <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":""}"
1378
+ style=${P(e)?`--sf-property-view--edge-room: calc(${e.edgeControlCount} * ${e.edgeControlWidth} + ${e.edgeControlCount-1} * var(--sf-space-1\\/2));`:n.nothing}
1406
1379
  data-record-id=${e.recordId||""}
1407
1380
  data-stack-depth=${String(e.stackDepth)}
1408
1381
  data-stacked=${e.isTopPanel?"false":"true"}
@@ -1410,12 +1383,12 @@
1410
1383
  ${V(e)}
1411
1384
  <div class="sf-property-view-scroll flex-auto min-h-0 ${t?"flex":"flex flex-col"}">
1412
1385
  ${t?n.html`
1413
- ${x(e,c(e,e.sections))}
1386
+ ${w(e,l(e,e.sections))}
1414
1387
  <div class="sf-property-view-frame flex-auto min-w-0 flex flex-col gap-2">
1415
1388
  ${Y(e,!0,!1)}
1416
1389
  </div>`:Y(e,!1,!1)}
1417
1390
  </div>
1418
- ${z(e,{panel:!0})}
1391
+ ${C(e,{panel:!0})}
1419
1392
  </div>
1420
1393
  </sf-drawer>
1421
- `}r()}catch(Q){r(Q)}})},"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.9.1","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","date-invalid-text":"The date is not a calendar date","date-missing-text":"Enter the date","date-time-date-label":"{label}: date","date-time-time-label":"{label}: time","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","time-invalid-text":"Enter the time as hh:mm, from 00:00 to 23:59","time-missing-text":"Enter the time","time-placeholder-text":"hh:mm","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":"Создать","date-invalid-text":"Дата указана неверно","date-missing-text":"Укажите дату","date-time-date-label":"{label}: дата","date-time-time-label":"{label}: время","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":"Запись недоступна","time-invalid-text":"Укажите время в виде чч:мм, от 00:00 до 23:59","time-missing-text":"Укажите время","time-placeholder-text":"чч:мм","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")})();
1394
+ `}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.1","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")})();