@simai-studio/view 1.3.0 → 1.4.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.
- package/README.md +4 -4
- package/dist/package-receipt.json +106 -106
- package/dist/set.json +1 -1
- package/dist/smart/view/component.json +19 -10
- package/dist/smart/view/component.json.gz +0 -0
- package/dist/smart/view/js/view.js +2 -2
- package/dist/smart/view/js/view.js.gz +0 -0
- package/dist/smart/view/js/view.min.js +1 -1
- package/dist/smart/view/js/view.min.js.gz +0 -0
- package/dist/smart/view/smart.manifest.json +14 -6
- package/dist/smart/view/smart.manifest.json.gz +0 -0
- package/dist/smart/view/static/default/open-record.html +1 -1
- package/dist/smart/view/static/default/open-record.html.gz +0 -0
- package/dist/smart/view/static/default/reference.html +1 -1
- package/dist/smart/view/static/default/reference.html.gz +0 -0
- package/dist/smart/view-flow/js/view-flow.js +388 -31
- package/dist/smart/view-flow/js/view-flow.js.gz +0 -0
- package/dist/smart/view-flow/js/view-flow.min.js +213 -201
- package/dist/smart/view-flow/js/view-flow.min.js.gz +0 -0
- package/dist/smart/view-flow/static/default/ask.html +1 -1
- package/dist/smart/view-flow/static/default/ask.html.gz +0 -0
- package/dist/smart/view-flow/static/default/reference.html +2 -2
- package/dist/smart/view-flow/static/default/reference.html.gz +0 -0
- package/dist/smart/view-properties/component.json +8 -1
- package/dist/smart/view-properties/component.json.gz +0 -0
- package/dist/smart/view-properties/css/view-properties.css +17 -4
- package/dist/smart/view-properties/css/view-properties.css.gz +0 -0
- package/dist/smart/view-properties/css/view-properties.min.css +1 -1
- package/dist/smart/view-properties/css/view-properties.min.css.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.js +389 -32
- package/dist/smart/view-properties/js/view-properties.js.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.min.js +167 -155
- package/dist/smart/view-properties/js/view-properties.min.js.gz +0 -0
- package/dist/smart/view-properties/smart.manifest.json +9 -2
- package/dist/smart/view-properties/smart.manifest.json.gz +0 -0
- package/dist/smart/view-properties/template/default.css +13 -2
- package/dist/smart/view-properties/template/default.css.gz +0 -0
- package/dist/smart/view-table/component.json +8 -1
- package/dist/smart/view-table/component.json.gz +0 -0
- package/dist/smart/view-table/js/view-table.js +393 -33
- package/dist/smart/view-table/js/view-table.js.gz +0 -0
- package/dist/smart/view-table/js/view-table.min.js +152 -139
- package/dist/smart/view-table/js/view-table.min.js.gz +0 -0
- package/dist/smart/view-table/smart.manifest.json +9 -2
- package/dist/smart/view-table/smart.manifest.json.gz +0 -0
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(()=>{"use strict";var e={e577837dd70a(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{Yq:()=>l});var r=n("15b4e93ff6ed"),s=e([r]),o=s.then?(await s)():s;r=o[0];function a(e){return"short"===e||"medium"===e||"long"===e||"full"===e}function l(e,{date:t="medium",time:n=null,intl:i=null,gap:s="",...o}={}){const l=(0,r.ay)(e);if(!l)return s;let c=i;return c||(c={},a(t)&&(c.dateStyle=t),a(n)&&(c.timeStyle=n),c.dateStyle||c.timeStyle||(c.dateStyle="medium")),(0,r.Qz)("DateTimeFormat",(0,r.OE)(o),c).format(l)}i()}catch(c){i(c)}})},"15b4e93ff6ed"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{OE:()=>a,Qz:()=>u,ay:()=>l});var r=n("43090d1c8307"),s=e([r]),o=s.then?(await s)():s;r=o[0];function a({locale:e,node:t}={}){return String(e||"").trim()||(0,r.pageLocale)(t)}function l(e){if(null==e||""===e)return null;const t=e instanceof Date?new Date(e.getTime()):new Date("string"==typeof e&&/^\d+$/u.test(e)?Number(e):e);return Number.isNaN(t.getTime())?null:t}function c(){const e="undefined"!=typeof globalThis?globalThis:{};return e.__sfFormat||(e.__sfFormat={formatters:new Map}),e.__sfFormat.formatters}function u(e,t,n){const i=`${e}|${t}|${JSON.stringify(n)}`,r=c();if(r.has(i))return r.get(i);const s=Intl[e];let o;try{o=new s(t||void 0,n)}catch{try{o=new s(void 0,n)}catch{o=new s(t||void 0,"NumberFormat"===e?{maximumFractionDigits:2}:{})}}return r.size>=256&&r.delete(r.keys().next().value),r.set(i,o),o}i()}catch(d){i(d)}})},"1b42c5117087"(e,t,n){const i=Object.freeze(["folder","folder_open","topic","home","dashboard","apartment","store","storefront","business_center","work","badge","person","group","groups","account_circle","manage_accounts","supervisor_account","contacts","school","menu_book","assignment","task","description","article","note_alt","edit_note","draft","receipt","receipt_long","request_quote","inventory_2","category","label","sell","local_offer","shopping_cart","shopping_bag","payments","savings","credit_card","account_balance","calculate","percent","trending_up","analytics","insights","monitoring","bar_chart","pie_chart","table_chart","schedule","event","today","calendar_month","date_range","history","alarm","timer","update","hourglass_top","mail","outgoing_mail","chat","forum","sms","call","phone_in_talk","contact_support","campaign","notifications","language","public","place","map","location_on","travel_explore","flight","local_shipping","route","directions","settings","tune","build","construction","handyman","code","terminal","data_object","api","bug_report","database","storage","cloud","backup","sync","folder_zip","upload_file","download","attach_file","link","lock","lock_open","shield","verified_user","key","admin_panel_settings","policy","gavel","fingerprint","visibility","palette","format_paint","image","photo_library","collections","movie","play_circle","mic","headphones","brush"]);"undefined"!=typeof globalThis&&(globalThis.SF=globalThis.SF||{},globalThis.SF.icons=globalThis.SF.icons||{},globalThis.SF.icons.choices||(globalThis.SF.icons.choices=i));n.d(t,["x",0,i])},"9ce1a42b2a85"(e,t,n){n.d(t,{AC:()=>o,MC:()=>d,SB:()=>u,cy:()=>l,d2:()=>a});const i=/^(\d{4}-\d{2}-\d{2})(?:[T ](\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/u,r=/^\d{4}-\d{2}-\d{2}$/u;function s(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e}function o(e){const t=s(e);if(null==t||""===t)return{raw:t??null,known:!0,date:"",time:"",rest:"",zone:""};const n="string"==typeof t?t.trim().match(i):null;return n?{raw:t,known:!0,date:n[1],time:n[2]?`${n[2]}:${n[3]}`:"",rest:n[4]||"",zone:n[5]||""}:{raw:t,known:!1,date:"",time:"",rest:"",zone:""}}function a(e){const t=String(e??"").trim().replace(/[_\s]/gu,"");if(""===t||":"===t)return"";const n=t.match(/^(\d{1,2})[:.]?(\d{2})$/u);if(!n)return null;const i=Number(n[1]),r=Number(n[2]);return i>23||r>59?null:`${String(i).padStart(2,"0")}:${n[2]}`}function l(e,t){const n=String(t?.date??"").trim(),i=a(t?.time);if(null===i)return{error:"timeInvalid"};if(!n&&!i)return{value:null};if(!r.test(n))return{error:n?"dateInvalid":"dateMissing"};if(!i)return{error:"timeMissing"};const s=e?.known?e:null;if(s&&s.date===n&&s.time===i)return{value:s.raw};return{value:`${n}T${i}${s&&s.time===i?s.rest:":00"}${s&&s.time?s.zone:""}`}}const c=/^(\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?$/u;function u(e){const t=s(e);if(null==t||""===t)return{raw:t??null,known:!0,time:"",rest:""};const n="string"==typeof t?t.trim().match(c):null;return n&&null!==a(`${n[1]}:${n[2]}`)?{raw:t,known:!0,time:`${n[1]}:${n[2]}`,rest:n[3]||""}:{raw:t,known:!1,time:"",rest:""}}function d(e,t){const n=a(t);if(null===n)return{error:"timeInvalid"};if(!n)return{value:null};const i=e?.known?e:null;return i&&i.time===n?{value:i.raw}:{value:i?.rest?`${n}:00`:n}}},eb06ad68f8d3(e,t,n){n.d(t,{b:()=>D,j:()=>M});Object.freeze(["p","h2","h3","h4","strong","em","a","ul","ol","li","blockquote","br"]);const i=Object.freeze(["p","h2","h3","h4"]),r=Object.freeze(["https:","mailto:","tel:"]),s=Object.freeze(["html","paste"]),o=(Object.freeze(["pre","table"]),new Set(["script","style","template","head","title","meta","link","base","noscript","iframe","frame","frameset","noembed","noframes","object","embed","applet","svg","math","canvas","video","audio","img","picture","source","track","input","select","textarea","xmp","plaintext"])),a=new Set(["address","article","aside","body","caption","center","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h5","h6","header","hgroup","hr","html","legend","listing","main","menu","nav","optgroup","option","pre","section","summary","table","tbody","td","tfoot","th","thead","tr"]),l=new Set(["ul","ol"]),c=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),u=new Set(["script","style","textarea","title","xmp","iframe","noembed","noframes","noscript"]),d=new Set(["td","th","table","caption","button"]),p=/[\u0000-\u001f\u007f-\u009f]/gu,h=/[\u0000- \u007f-\u009f\u00a0\u1680\u2000-\u200b\u2028\u2029\u202f\u205f\u3000\ufeff]/gu;const f={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",shy:"",hellip:"…",mdash:"—",ndash:"–",minus:"−",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",bull:"•",middot:"·",copy:"©",reg:"®",trade:"™",deg:"°",times:"×",divide:"÷",plusmn:"±",euro:"€",pound:"£",yen:"¥",cent:"¢",sect:"§",para:"¶",thinsp:" ",ensp:" ",emsp:" ",zwj:"",zwnj:"",larr:"←",rarr:"→",uarr:"↑",darr:"↓",numero:"№",prime:"′",Prime:"″"};function g(e){return String(e).replace(/&(#x[0-9a-f]+|#[0-9]+|[a-z][a-z0-9]*);?/giu,(e,t)=>{if("#"===t[0]){const e="x"===t[1]||"X"===t[1]?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return!Number.isFinite(e)||e<=0||e>1114111||e>=55296&&e<=57343?"�":String.fromCodePoint(e)}return Object.hasOwn(f,t)&&e.endsWith(";")?f[t]:e})}function m(e){const t="string"==typeof e?e:"",n={type:"element",name:"#root",attrs:{},children:[]},r=[n],s=()=>r[r.length-1],o=e=>s().children.push(e),p=e=>{if(!e)return;const t=s().children.at(-1);"text"===t?.type?t.value+=e:o({type:"text",value:e})},h=(e,t=null)=>{for(let n=r.length-1;n>0;n-=1){const i=r[n].name;if(t&&t.has(i))return!1;if(i===e)return r.length=n,!0}return!1};let f=0;const m=t.length;for(;f<m;){const e=t.indexOf("<",f);if(e<0){p(g(t.slice(f)));break}if(e>f&&p(g(t.slice(f,e))),f=e,t.startsWith("\x3c!--",f)){const e=t.indexOf("--\x3e",f+4);f=e<0?m:e+3;continue}const n=t[f+1]??"";if("!"===n||"?"===n){const e=t.indexOf(">",f+2);f=e<0?m:e+1;continue}if("/"===n){const e=/^<\/([a-z][a-z0-9-]*)[^>]*>?/iu.exec(t.slice(f));if(!e){const e=t.indexOf(">",f+2);f=e<0?m:e+1;continue}f+=e[0].length;const n=e[1].toLowerCase();"br"===n?o({type:"element",name:"br",attrs:{},children:[]}):"p"!==n||h("p",d)?h(n):o({type:"element",name:"p",attrs:{},children:[]});continue}const s=/^<([a-z][a-z0-9-]*)/iu.exec(t.slice(f));if(!s){p("<"),f+=1;continue}f+=s[0].length;const v=s[1].toLowerCase(),y={};let b=!1;for(;f<m;){const e=/^[\s/]+/u.exec(t.slice(f));if(e){e[0].includes("/")&&">"===t[f+e[0].length]&&(b=!0),f+=e[0].length;continue}if(">"===t[f]){f+=1;break}const n=/^([^\s/>"'=][^\s/>"'=]*)(?:\s*=\s*(?:"([^"]*)"?|'([^']*)'?|([^\s>]*)))?/u.exec(t.slice(f));if(!n){f+=1;continue}f+=n[0].length;const i=n[1].toLowerCase();Object.hasOwn(y,i)||(y[i]=g(n[2]??n[3]??n[4]??""))}const w={type:"element",name:v,attrs:y,children:[]};if("li"===v&&h("li",l),(i.includes(v)||l.has(v)||"blockquote"===v||a.has(v))&&h("p",d),o(w),"plaintext"===v){f=m;break}if(u.has(v)){const e=new RegExp(`</${v}[\\s/>]`,"iu").exec(t.slice(f)),n=e?f+e.index:m;"textarea"===v||"title"===v?w.children.push({type:"text",value:g(t.slice(f,n))}):w.children.push({type:"text",value:t.slice(f,n)});const i=e?t.indexOf(">",n):-1;f=i<0?m:i+1;continue}c.has(v)||b||r.push(w)}return n}function v(e){const t=e=>{if(3===e.nodeType)return{type:"text",value:e.data};if(11===e.nodeType)return{type:"element",name:"#root",attrs:{},children:[...e.childNodes].map(t).filter(Boolean)};if(1!==e.nodeType)return null;if(e.namespaceURI&&"http://www.w3.org/1999/xhtml"!==e.namespaceURI)return null;const n=e.localName;if(o.has(n))return null;const i={},r=e.getAttribute("href");null!==r&&(i.href=r);const s=e.getAttribute("style");null!==s&&(i.style=s);return{type:"element",name:n,attrs:i,children:"template"===n?[]:[...e.childNodes].map(t).filter(Boolean)}},n=t(e);return n&&"element"===n.type?{...n,name:"#root"}:{type:"element",name:"#root",attrs:{},children:n?[n]:[]}}function y(e,t){const n={...t};"strong"!==e.name&&"b"!==e.name||(n.strong=!0),"em"!==e.name&&"i"!==e.name||(n.em=!0);const i=function(e){const t={};if(!e)return t;const n=/(?:^|;)\s*font-weight\s*:\s*([^;!]+)/iu.exec(e)?.[1]?.trim().toLowerCase();n&&("bold"===n||"bolder"===n||Number(n)>=600?t.strong=!0:("normal"===n||"lighter"===n||Number(n)<600)&&(t.strong=!1));const i=/(?:^|;)\s*font-style\s*:\s*([^;!]+)/iu.exec(e)?.[1]?.trim().toLowerCase();return i&&("italic"===i||i.startsWith("oblique")?t.em=!0:"normal"===i&&(t.em=!1)),t}(e.attrs?.style);return void 0!==i.strong&&(n.strong=i.strong),void 0!==i.em&&(n.em=i.em),n}const b=(e,t,n)=>({kind:e,value:t,strong:Boolean(n.marks.strong),em:Boolean(n.marks.em),href:n.href||null});class w{constructor(e){this.kind=e,this.blocks=[],this.run=[],this.types=["p"],this.starts=[0],this.needBreak=!1}inline(e){"item"===this.kind&&this.needBreak&&this.run.length>0&&("text"!==e.kind||e.value.trim())&&(this.run.push({kind:"br",strong:!1,em:!1,href:null}),this.needBreak=!1),this.run.push(e)}flush(){this.run.length&&("item"===this.kind?this.blocks.push({type:"inline",leaves:this.run}):this.blocks.push({type:this.types[this.types.length-1],leaves:this.run}),this.run=[])}open(e){"item"!==this.kind?(this.flush(),this.types.push(e),this.starts.push(this.blocks.length)):this.needBreak=!0}close(e=!1){if("item"===this.kind)return void(this.needBreak=!0);const t=this.starts[this.starts.length-1];e&&!this.run.length&&this.blocks.length===t&&this.blocks.push({type:this.types[this.types.length-1],leaves:[]}),this.flush(),this.types.length>1&&(this.types.pop(),this.starts.pop())}block(e){this.flush(),this.blocks.push(e),this.needBreak=!1}}function x(e,t,n){for(const i of e)$(i,t,n)}function $(e,t,n){if("text"===e.type)return void function(e,t,n){if(n.pre)return void e.replace(/\r\n?/gu,"\n").split("\n").forEach((e,i)=>{i>0&&t.inline(b("br","",n)),e&&t.inline(b("text",e.replace(/[\t\f]/gu," "),n))});const i=e.replace(/[\t\n\r\f ]+/gu," ");i&&(" "!==i||t.run.length)&&t.inline(b("text",i,n))}(e.value,t,n);const s=e.name;if(o.has(s))return;if("br"===s)return void t.inline(b("br","",n));const c={...n,marks:y(e,n.marks)};if("a"===s){const i=function(e){if("string"!=typeof e)return null;const t=e.trim();if(!t||t.length>2048)return null;const n=t.replace(h,"");if(!n)return null;if(n.startsWith("/")){if(/^\/[/\\]/u.test(n))return null;const e=t.replace(p,"");return/^\/[/\\]/u.test(e)?null:e}const i=/^([a-z][a-z0-9+.-]*):/iu.exec(n)?.[1]?.toLowerCase();if(!i||!r.includes(`${i}:`))return null;let s;try{s=new globalThis.URL(t.replace(p,""))}catch{return null}return s.protocol!==`${i}:`?null:"https:"!==s.protocol||s.hostname?"https:"!==s.protocol&&s.href.length<=s.protocol.length?null:s.href:null}(e.attrs?.href);return void x(e.children,t,i&&!n.href?{...c,href:i}:c)}if(i.includes(s))return t.open(s),x(e.children,t,c),void t.close(!0);if(l.has(s)){const n=_(e,c,s);return void(n.items.length&&t.block(n))}if("blockquote"===s){if("item"===t.kind)return t.open("p"),x(e.children,t,c),void t.close();const n=new w("flow");return x(e.children,n,c),n.flush(),void t.block({type:"blockquote",blocks:n.blocks})}if("li"===s)return t.open("p"),x(e.children,t,c),void t.close();if(!n.paste||"item"===t.kind||"pre"!==s&&"listing"!==s){if(!n.paste||"item"===t.kind||"table"!==s)return a.has(s)?(t.open("p"),x(e.children,t,"pre"===s||"listing"===s?{...c,pre:!0}:c),void t.close()):void x(e.children,t,c);t.block(function(e,t){const n={type:"table",caption:[],rows:[]},i=(e,i)=>{const r=[];for(const n of e.children){if("element"!==n.type||"td"!==n.name&&"th"!==n.name)continue;const e=new w("item");x(n.children,e,{...t,marks:y(n,t.marks)}),e.flush(),r.push({header:"th"===n.name,leaves:S(e.blocks)})}r.length&&n.rows.push({head:i,cells:r})},r=(e,t)=>{for(const n of e.children)"element"===n.type&&"tr"===n.name&&i(n,t)};for(const s of e.children)if("element"===s.type)if("caption"===s.name){const e=new w("item");x(s.children,e,t),e.flush(),n.caption=S(e.blocks)}else"thead"===s.name?r(s,!0):"tbody"===s.name||"tfoot"===s.name?r(s,!1):"tr"===s.name&&i(s,!1);return n}(e,c))}else t.block({type:"pre",text:k(e)})}function k(e){const t=e=>"text"===e.type?e.value:o.has(e.name)?"":"br"===e.name?"\n":e.children.map(t).join("");return e.children.map(t).join("").replace(/\r\n?/gu,"\n").replace(/\u00a0/gu," ").replace(/^\n/u,"").replace(/\s+$/u,"")}function S(e){const t=[],n=e=>{if("inline"===e.type)(i=e.leaves).length&&(t.length&&t.push({kind:"br",strong:!1,em:!1,href:null}),t.push(...i));else for(const t of e.items)t.children.forEach(n);var i};return e.forEach(n),t}function T(e,t){const n=new w("item");return x(e.children,n,t),n.flush(),{children:n.blocks}}function _(e,t,n){const i={type:n,items:[]};let r=null;const s=()=>{r&&(r.flush(),i.items.push({children:r.blocks}),r=null)};for(const n of e.children)if("element"!==n.type||"li"!==n.name){if("element"===n.type&&l.has(n.name)){s();const e=_(n,{...t,marks:y(n,t.marks)},n.name);if(!e.items.length)continue;const r=i.items.at(-1);r?r.children.push(e):i.items.push({children:[e]});continue}("text"!==n.type||n.value.trim())&&("element"===n.type&&o.has(n.name)||(r??=new w("item"),$(n,r,t)))}else s(),i.items.push(T(n,t));return s(),i}const A=" ",F=(e,t)=>e.strong===t.strong&&e.em===t.em&&e.href===t.href;function C(e,t){const n=[];for(const t of e){if("text"===t.kind&&!t.value)continue;const e=n.at(-1);"text"===t.kind&&"text"===e?.kind&&F(e,t)?e.value+=t.value:n.push({...t})}for(let e=0;e<n.length;e+=1){const t=n[e];if("text"!==t.kind)continue;t.value=t.value.replace(/ {2,}/gu,A);const i=n[e-1];t.value.startsWith(A)&&(!i||"br"===i.kind||"text"===i.kind&&i.value.endsWith(A))&&(t.value=t.value.slice(1));const r=n[e+1];!t.value.endsWith(A)||r&&"br"!==r.kind||(t.value=t.value.slice(0,-1))}let i=n.filter(e=>"br"===e.kind||e.value);if("value"===t){for(;"br"===i[0]?.kind;)i.shift();for(;"br"===i.at(-1)?.kind;)i.pop();"text"===i[0]?.kind&&(i[0].value=i[0].value.replace(/^[\s\u00a0]+/u,""));const e=i.at(-1);"text"===e?.kind&&(e.value=e.value.replace(/[\s\u00a0]+$/u,"")),i=i.filter(e=>"br"===e.kind||e.value)}const r=new Map;for(const e of i)e.href&&r.set(e.href,(r.get(e.href)||"")+("text"===e.kind?e.value:"x"));for(const e of i)e.href&&!r.get(e.href).trim()&&(e.href=null);const s=[];for(const e of i){const t=s.at(-1);"text"===e.kind&&"text"===t?.kind&&F(t,e)?t.value+=e.value:s.push(e)}return s}const z=e=>e.some(e=>"text"===e.kind&&""!==e.value.replace(/[\s\u00a0]+/gu,""));function E(e,t){const n=e.items.map(e=>function(e,t){const n=[];for(const i of e.children)if("inline"===i.type){const e=C(i.leaves,t);if(!e.length)continue;const r=n.at(-1);"inline"===r?.type?r.leaves=C([...r.leaves,{kind:"br",strong:!1,em:!1,href:null},...e],t):n.push({type:"inline",leaves:e})}else{const e=E(i,t);if(!e)continue;const r=n.at(-1);r&&r.type===e.type?r.items.push(...e.items):n.push(e)}if("value"===t){const e=n.filter(e=>"inline"!==e.type||z(e.leaves));return e.length?{children:e}:null}return n.length&&"inline"===n[0].type||n.unshift({type:"inline",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}),{children:n}}(e,t)).filter(Boolean);return n.length?{type:e.type,items:n}:null}function q(e,t){const n=[];for(const i of e){let e=null;if("blockquote"===i.type){const n=q(i.blocks,t);n.length?e={type:"blockquote",blocks:n}:"editor"===t&&(e={type:"blockquote",blocks:[{type:"p",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}]})}else if(l.has(i.type))e=E(i,t);else if("pre"===i.type)i.text.trim()&&(e={type:"pre",text:i.text});else if("table"===i.type){const t=i.rows.map(e=>({head:e.head,cells:e.cells.map(e=>({header:e.header,leaves:C(e.leaves,"value")}))})).filter(e=>e.cells.some(e=>z(e.leaves)));t.length&&(e={type:"table",caption:C(i.caption,"value"),rows:t})}else{const n=C(i.leaves,t);"value"===t?z(n)&&(e={type:i.type,leaves:n}):e={type:i.type,leaves:n.length?n:[{kind:"br",strong:!1,em:!1,href:null}]}}if(!e)continue;const r=n.at(-1);r&&l.has(e.type)&&r.type===e.type?r.items.push(...e.items):n.push(e)}return n}function L(e,{mode:t="value",profile:n="html"}={}){if(!s.includes(n))throw new TypeError(`rich_text_profile_unknown: ${n}`);const i=new w("flow");x(e.children??[],i,{marks:{},href:null,pre:!1,paste:"paste"===n}),i.flush();const r=q(i.blocks,t);return"editor"!==t||r.length?r:[{type:"p",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}]}const O=e=>e.replace(/&/gu,"&").replace(/"/gu,""").replace(/</gu,"<").replace(/>/gu,">").replace(/\u00a0/gu," ");function P(e){const t=(e,n)=>{let i="",r=0;const s=["href","strong","em"][n];for(;r<e.length;){const o=s?e[r][s]:null;let a=r+1;for(;a<e.length&&s&&e[a][s]===o;)a+=1;const l=e.slice(r,a);i+=s?"href"===s&&o?`<a href="${O(o)}">${t(l,n+1)}</a>`:"href"!==s&&o?`<${s}>${t(l,n+1)}</${s}>`:t(l,n+1):l.map(e=>"br"===e.kind?"<br>":e.value.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/\u00a0/gu," ")).join(""),r=a}return i};return t(e,0)}function V(e){return`<${e.type}>${e.items.map(e=>`<li>${e.children.map(e=>"inline"===e.type?P(e.leaves):V(e)).join("")}</li>`).join("")}</${e.type}>`}function I(e){return e.map(e=>{if("blockquote"===e.type)return`<blockquote>${I(e.blocks)}</blockquote>`;if(l.has(e.type))return V(e);if("pre"===e.type){return`<p>${P(C(e.text.split("\n").flatMap((e,t)=>[...t?[{kind:"br",strong:!1,em:!1,href:null}]:[],{kind:"text",value:e.replace(/[\t\f]/gu," "),strong:!1,em:!1,href:null}]),"value"))}</p>`}if("table"===e.type){return[{leaves:e.caption},...e.rows.flatMap(e=>e.cells)].filter(e=>z(e.leaves)).map(e=>`<p>${P(e.leaves)}</p>`).join("")}return`<${e.type}>${P(e.leaves)}</${e.type}>`}).join("")}const R=e=>{const t=e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;return"string"==typeof t?t:""};function D(e){const t=R(e);return t?function(e,{mode:t="value",document:n}={}){let i;if(e&&"object"==typeof e&&"number"==typeof e.nodeType)i=v(e);else{const t="string"==typeof e?e:"",r=void 0===n?globalThis.document:n;if(t&&r?.createElement){const e=r.createElement("template");e.innerHTML=t,i=v(e.content)}else i=m(t)}return I(L(i,{mode:t}))}(t,{mode:"value"}):""}function M(e){const t=R(e);return t?function(e){const t=L(m(e),{mode:"value"}),n=e=>e.map(e=>"br"===e.kind?"\n":e.value).join(""),i=e=>e.items.map(e=>e.children.map(e=>"inline"===e.type?n(e.leaves):i(e)).join("\n")).join("\n"),r=e=>e.map(e=>"blockquote"===e.type?r(e.blocks):l.has(e.type)?i(e):n(e.leaves)).join("\n\n");return r(t)}(t).replace(/\s+/gu," ").trim():""}},e5483002f3ea(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{oX:()=>ct,z4:()=>We});var r=n("2a080a730149"),s=n("073f05ff1a81"),o=n("5961360f41f4"),a=n("43090d1c8307"),l=n("fc654eb7fab0"),c=n("9ce1a42b2a85"),u=n("dd6973f77245"),d=n("eb06ad68f8d3"),p=e([r,s,a]);[r,s,a]=p.then?(await p)():p;function h(e){return String(e?.size||"").trim()||"1"}function f(e,t){const n=t.getFilterControlValue(e.key);return r.html`
|
|
1
|
+
(()=>{"use strict";var e={e577837dd70a(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{Yq:()=>l});var r=n("15b4e93ff6ed"),s=e([r]),o=s.then?(await s)():s;r=o[0];function a(e){return"short"===e||"medium"===e||"long"===e||"full"===e}function l(e,{date:t="medium",time:n=null,intl:i=null,gap:s="",...o}={}){const l=(0,r.ay)(e);if(!l)return s;let c=i;return c||(c={},a(t)&&(c.dateStyle=t),a(n)&&(c.timeStyle=n),c.dateStyle||c.timeStyle||(c.dateStyle="medium")),(0,r.Qz)("DateTimeFormat",(0,r.OE)(o),c).format(l)}i()}catch(c){i(c)}})},"15b4e93ff6ed"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{OE:()=>a,Qz:()=>u,ay:()=>l});var r=n("43090d1c8307"),s=e([r]),o=s.then?(await s)():s;r=o[0];function a({locale:e,node:t}={}){return String(e||"").trim()||(0,r.pageLocale)(t)}function l(e){if(null==e||""===e)return null;const t=e instanceof Date?new Date(e.getTime()):new Date("string"==typeof e&&/^\d+$/u.test(e)?Number(e):e);return Number.isNaN(t.getTime())?null:t}function c(){const e="undefined"!=typeof globalThis?globalThis:{};return e.__sfFormat||(e.__sfFormat={formatters:new Map}),e.__sfFormat.formatters}function u(e,t,n){const i=`${e}|${t}|${JSON.stringify(n)}`,r=c();if(r.has(i))return r.get(i);const s=Intl[e];let o;try{o=new s(t||void 0,n)}catch{try{o=new s(void 0,n)}catch{o=new s(t||void 0,"NumberFormat"===e?{maximumFractionDigits:2}:{})}}return r.size>=256&&r.delete(r.keys().next().value),r.set(i,o),o}i()}catch(d){i(d)}})},"1b42c5117087"(e,t,n){const i=Object.freeze(["folder","folder_open","topic","home","dashboard","apartment","store","storefront","business_center","work","badge","person","group","groups","account_circle","manage_accounts","supervisor_account","contacts","school","menu_book","assignment","task","description","article","note_alt","edit_note","draft","receipt","receipt_long","request_quote","inventory_2","category","label","sell","local_offer","shopping_cart","shopping_bag","payments","savings","credit_card","account_balance","calculate","percent","trending_up","analytics","insights","monitoring","bar_chart","pie_chart","table_chart","schedule","event","today","calendar_month","date_range","history","alarm","timer","update","hourglass_top","mail","outgoing_mail","chat","forum","sms","call","phone_in_talk","contact_support","campaign","notifications","language","public","place","map","location_on","travel_explore","flight","local_shipping","route","directions","settings","tune","build","construction","handyman","code","terminal","data_object","api","bug_report","database","storage","cloud","backup","sync","folder_zip","upload_file","download","attach_file","link","lock","lock_open","shield","verified_user","key","admin_panel_settings","policy","gavel","fingerprint","visibility","palette","format_paint","image","photo_library","collections","movie","play_circle","mic","headphones","brush"]);"undefined"!=typeof globalThis&&(globalThis.SF=globalThis.SF||{},globalThis.SF.icons=globalThis.SF.icons||{},globalThis.SF.icons.choices||(globalThis.SF.icons.choices=i));n.d(t,["x",0,i])},"9ce1a42b2a85"(e,t,n){n.d(t,{AC:()=>o,MC:()=>d,SB:()=>u,cy:()=>l,d2:()=>a});const i=/^(\d{4}-\d{2}-\d{2})(?:[T ](\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/u,r=/^\d{4}-\d{2}-\d{2}$/u;function s(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e}function o(e){const t=s(e);if(null==t||""===t)return{raw:t??null,known:!0,date:"",time:"",rest:"",zone:""};const n="string"==typeof t?t.trim().match(i):null;return n?{raw:t,known:!0,date:n[1],time:n[2]?`${n[2]}:${n[3]}`:"",rest:n[4]||"",zone:n[5]||""}:{raw:t,known:!1,date:"",time:"",rest:"",zone:""}}function a(e){const t=String(e??"").trim().replace(/[_\s]/gu,"");if(""===t||":"===t)return"";const n=t.match(/^(\d{1,2})[:.]?(\d{2})$/u);if(!n)return null;const i=Number(n[1]),r=Number(n[2]);return i>23||r>59?null:`${String(i).padStart(2,"0")}:${n[2]}`}function l(e,t){const n=String(t?.date??"").trim(),i=a(t?.time);if(null===i)return{error:"timeInvalid"};if(!n&&!i)return{value:null};if(!r.test(n))return{error:n?"dateInvalid":"dateMissing"};if(!i)return{error:"timeMissing"};const s=e?.known?e:null;if(s&&s.date===n&&s.time===i)return{value:s.raw};return{value:`${n}T${i}${s&&s.time===i?s.rest:":00"}${s&&s.time?s.zone:""}`}}const c=/^(\d{2}):(\d{2})((?::\d{2})(?:\.\d+)?)?$/u;function u(e){const t=s(e);if(null==t||""===t)return{raw:t??null,known:!0,time:"",rest:""};const n="string"==typeof t?t.trim().match(c):null;return n&&null!==a(`${n[1]}:${n[2]}`)?{raw:t,known:!0,time:`${n[1]}:${n[2]}`,rest:n[3]||""}:{raw:t,known:!1,time:"",rest:""}}function d(e,t){const n=a(t);if(null===n)return{error:"timeInvalid"};if(!n)return{value:null};const i=e?.known?e:null;return i&&i.time===n?{value:i.raw}:{value:i?.rest?`${n}:00`:n}}},ab3947ea3647(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{PD:()=>u,e4:()=>c,l9:()=>g,up:()=>f});var r=n("15b4e93ff6ed"),s=e([r]),o=s.then?(await s)():s;r=o[0];const a=/^([+-]?)(\d*)(?:[.,](\d*))?$/u,l=/[\s ']/gu;function c(e){if(null==e)return{ok:!0,value:null};if("number"==typeof e)return Number.isSafeInteger(e)?{ok:!0,value:String(e)}:{ok:!1};const t=String(e).replace(l,"");if(""===t)return{ok:!0,value:null};const n=a.exec(t);if(!n)return{ok:!1};const[,i,r,s]=n;if(""===r&&""===(s??""))return{ok:!1};const o=r.replace(/^0+(?=\d)/u,"")||"0",c=s??"",u=/^0*$/u.test(o+c);return{ok:!0,value:`${"-"!==i||u?"":"-"}${o}${c?`.${c}`:""}`}}function u(e){const t=String(e??"").indexOf(".");return-1===t?0:String(e).length-t-1}function d(e){if("number"==typeof e)return Number.isFinite(e)?String(e):null;const t=c(e);return t.ok?t.value:null}function p(e,t){const n=d(e);if(null===n)return"";const i=Math.min(20,u(n));return(0,r.Qz)("NumberFormat",t,{minimumFractionDigits:i,maximumFractionDigits:i}).format(n)}function h(e,t){const n="string"==typeof t&&t?t:null;return e&&"object"==typeof e&&!Array.isArray(e)?{amount:e.amount??null,currency:n||(e.currency??null)}:null==e||""===e?{amount:null,currency:n}:{amount:e,currency:n}}function f(e,t={},n="en"){const{amount:i,currency:s}=h(e,t.currency),o=d(i);if(null===o)return"";if(!s)return p(o,n);const a=(0,r.Qz)("NumberFormat",n,{style:"currency",currency:s}).resolvedOptions().maximumFractionDigits??2,l=Math.min(20,Math.max(a,u(o)));return(0,r.Qz)("NumberFormat",n,{style:"currency",currency:s,currencyDisplay:"narrowSymbol",minimumFractionDigits:l,maximumFractionDigits:l}).format(o)}function g(e,t="en"){const n=d(e);if(null===n)return"";const i=Math.min(20,u(n));return(0,r.Qz)("NumberFormat",t,{style:"unit",unit:"percent",minimumFractionDigits:i,maximumFractionDigits:i}).format(n)}i()}catch(m){i(m)}})},eb06ad68f8d3(e,t,n){n.d(t,{b:()=>D,j:()=>N});Object.freeze(["p","h2","h3","h4","strong","em","a","ul","ol","li","blockquote","br"]);const i=Object.freeze(["p","h2","h3","h4"]),r=Object.freeze(["https:","mailto:","tel:"]),s=Object.freeze(["html","paste"]),o=(Object.freeze(["pre","table"]),new Set(["script","style","template","head","title","meta","link","base","noscript","iframe","frame","frameset","noembed","noframes","object","embed","applet","svg","math","canvas","video","audio","img","picture","source","track","input","select","textarea","xmp","plaintext"])),a=new Set(["address","article","aside","body","caption","center","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h5","h6","header","hgroup","hr","html","legend","listing","main","menu","nav","optgroup","option","pre","section","summary","table","tbody","td","tfoot","th","thead","tr"]),l=new Set(["ul","ol"]),c=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),u=new Set(["script","style","textarea","title","xmp","iframe","noembed","noframes","noscript"]),d=new Set(["td","th","table","caption","button"]),p=/[\u0000-\u001f\u007f-\u009f]/gu,h=/[\u0000- \u007f-\u009f\u00a0\u1680\u2000-\u200b\u2028\u2029\u202f\u205f\u3000\ufeff]/gu;const f={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",shy:"",hellip:"…",mdash:"—",ndash:"–",minus:"−",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",bull:"•",middot:"·",copy:"©",reg:"®",trade:"™",deg:"°",times:"×",divide:"÷",plusmn:"±",euro:"€",pound:"£",yen:"¥",cent:"¢",sect:"§",para:"¶",thinsp:" ",ensp:" ",emsp:" ",zwj:"",zwnj:"",larr:"←",rarr:"→",uarr:"↑",darr:"↓",numero:"№",prime:"′",Prime:"″"};function g(e){return String(e).replace(/&(#x[0-9a-f]+|#[0-9]+|[a-z][a-z0-9]*);?/giu,(e,t)=>{if("#"===t[0]){const e="x"===t[1]||"X"===t[1]?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return!Number.isFinite(e)||e<=0||e>1114111||e>=55296&&e<=57343?"�":String.fromCodePoint(e)}return Object.hasOwn(f,t)&&e.endsWith(";")?f[t]:e})}function m(e){const t="string"==typeof e?e:"",n={type:"element",name:"#root",attrs:{},children:[]},r=[n],s=()=>r[r.length-1],o=e=>s().children.push(e),p=e=>{if(!e)return;const t=s().children.at(-1);"text"===t?.type?t.value+=e:o({type:"text",value:e})},h=(e,t=null)=>{for(let n=r.length-1;n>0;n-=1){const i=r[n].name;if(t&&t.has(i))return!1;if(i===e)return r.length=n,!0}return!1};let f=0;const m=t.length;for(;f<m;){const e=t.indexOf("<",f);if(e<0){p(g(t.slice(f)));break}if(e>f&&p(g(t.slice(f,e))),f=e,t.startsWith("\x3c!--",f)){const e=t.indexOf("--\x3e",f+4);f=e<0?m:e+3;continue}const n=t[f+1]??"";if("!"===n||"?"===n){const e=t.indexOf(">",f+2);f=e<0?m:e+1;continue}if("/"===n){const e=/^<\/([a-z][a-z0-9-]*)[^>]*>?/iu.exec(t.slice(f));if(!e){const e=t.indexOf(">",f+2);f=e<0?m:e+1;continue}f+=e[0].length;const n=e[1].toLowerCase();"br"===n?o({type:"element",name:"br",attrs:{},children:[]}):"p"!==n||h("p",d)?h(n):o({type:"element",name:"p",attrs:{},children:[]});continue}const s=/^<([a-z][a-z0-9-]*)/iu.exec(t.slice(f));if(!s){p("<"),f+=1;continue}f+=s[0].length;const v=s[1].toLowerCase(),y={};let b=!1;for(;f<m;){const e=/^[\s/]+/u.exec(t.slice(f));if(e){e[0].includes("/")&&">"===t[f+e[0].length]&&(b=!0),f+=e[0].length;continue}if(">"===t[f]){f+=1;break}const n=/^([^\s/>"'=][^\s/>"'=]*)(?:\s*=\s*(?:"([^"]*)"?|'([^']*)'?|([^\s>]*)))?/u.exec(t.slice(f));if(!n){f+=1;continue}f+=n[0].length;const i=n[1].toLowerCase();Object.hasOwn(y,i)||(y[i]=g(n[2]??n[3]??n[4]??""))}const w={type:"element",name:v,attrs:y,children:[]};if("li"===v&&h("li",l),(i.includes(v)||l.has(v)||"blockquote"===v||a.has(v))&&h("p",d),o(w),"plaintext"===v){f=m;break}if(u.has(v)){const e=new RegExp(`</${v}[\\s/>]`,"iu").exec(t.slice(f)),n=e?f+e.index:m;"textarea"===v||"title"===v?w.children.push({type:"text",value:g(t.slice(f,n))}):w.children.push({type:"text",value:t.slice(f,n)});const i=e?t.indexOf(">",n):-1;f=i<0?m:i+1;continue}c.has(v)||b||r.push(w)}return n}function v(e){const t=e=>{if(3===e.nodeType)return{type:"text",value:e.data};if(11===e.nodeType)return{type:"element",name:"#root",attrs:{},children:[...e.childNodes].map(t).filter(Boolean)};if(1!==e.nodeType)return null;if(e.namespaceURI&&"http://www.w3.org/1999/xhtml"!==e.namespaceURI)return null;const n=e.localName;if(o.has(n))return null;const i={},r=e.getAttribute("href");null!==r&&(i.href=r);const s=e.getAttribute("style");null!==s&&(i.style=s);return{type:"element",name:n,attrs:i,children:"template"===n?[]:[...e.childNodes].map(t).filter(Boolean)}},n=t(e);return n&&"element"===n.type?{...n,name:"#root"}:{type:"element",name:"#root",attrs:{},children:n?[n]:[]}}function y(e,t){const n={...t};"strong"!==e.name&&"b"!==e.name||(n.strong=!0),"em"!==e.name&&"i"!==e.name||(n.em=!0);const i=function(e){const t={};if(!e)return t;const n=/(?:^|;)\s*font-weight\s*:\s*([^;!]+)/iu.exec(e)?.[1]?.trim().toLowerCase();n&&("bold"===n||"bolder"===n||Number(n)>=600?t.strong=!0:("normal"===n||"lighter"===n||Number(n)<600)&&(t.strong=!1));const i=/(?:^|;)\s*font-style\s*:\s*([^;!]+)/iu.exec(e)?.[1]?.trim().toLowerCase();return i&&("italic"===i||i.startsWith("oblique")?t.em=!0:"normal"===i&&(t.em=!1)),t}(e.attrs?.style);return void 0!==i.strong&&(n.strong=i.strong),void 0!==i.em&&(n.em=i.em),n}const b=(e,t,n)=>({kind:e,value:t,strong:Boolean(n.marks.strong),em:Boolean(n.marks.em),href:n.href||null});class w{constructor(e){this.kind=e,this.blocks=[],this.run=[],this.types=["p"],this.starts=[0],this.needBreak=!1}inline(e){"item"===this.kind&&this.needBreak&&this.run.length>0&&("text"!==e.kind||e.value.trim())&&(this.run.push({kind:"br",strong:!1,em:!1,href:null}),this.needBreak=!1),this.run.push(e)}flush(){this.run.length&&("item"===this.kind?this.blocks.push({type:"inline",leaves:this.run}):this.blocks.push({type:this.types[this.types.length-1],leaves:this.run}),this.run=[])}open(e){"item"!==this.kind?(this.flush(),this.types.push(e),this.starts.push(this.blocks.length)):this.needBreak=!0}close(e=!1){if("item"===this.kind)return void(this.needBreak=!0);const t=this.starts[this.starts.length-1];e&&!this.run.length&&this.blocks.length===t&&this.blocks.push({type:this.types[this.types.length-1],leaves:[]}),this.flush(),this.types.length>1&&(this.types.pop(),this.starts.pop())}block(e){this.flush(),this.blocks.push(e),this.needBreak=!1}}function x(e,t,n){for(const i of e)$(i,t,n)}function $(e,t,n){if("text"===e.type)return void function(e,t,n){if(n.pre)return void e.replace(/\r\n?/gu,"\n").split("\n").forEach((e,i)=>{i>0&&t.inline(b("br","",n)),e&&t.inline(b("text",e.replace(/[\t\f]/gu," "),n))});const i=e.replace(/[\t\n\r\f ]+/gu," ");i&&(" "!==i||t.run.length)&&t.inline(b("text",i,n))}(e.value,t,n);const s=e.name;if(o.has(s))return;if("br"===s)return void t.inline(b("br","",n));const c={...n,marks:y(e,n.marks)};if("a"===s){const i=function(e){if("string"!=typeof e)return null;const t=e.trim();if(!t||t.length>2048)return null;const n=t.replace(h,"");if(!n)return null;if(n.startsWith("/")){if(/^\/[/\\]/u.test(n))return null;const e=t.replace(p,"");return/^\/[/\\]/u.test(e)?null:e}const i=/^([a-z][a-z0-9+.-]*):/iu.exec(n)?.[1]?.toLowerCase();if(!i||!r.includes(`${i}:`))return null;let s;try{s=new globalThis.URL(t.replace(p,""))}catch{return null}return s.protocol!==`${i}:`?null:"https:"!==s.protocol||s.hostname?"https:"!==s.protocol&&s.href.length<=s.protocol.length?null:s.href:null}(e.attrs?.href);return void x(e.children,t,i&&!n.href?{...c,href:i}:c)}if(i.includes(s))return t.open(s),x(e.children,t,c),void t.close(!0);if(l.has(s)){const n=_(e,c,s);return void(n.items.length&&t.block(n))}if("blockquote"===s){if("item"===t.kind)return t.open("p"),x(e.children,t,c),void t.close();const n=new w("flow");return x(e.children,n,c),n.flush(),void t.block({type:"blockquote",blocks:n.blocks})}if("li"===s)return t.open("p"),x(e.children,t,c),void t.close();if(!n.paste||"item"===t.kind||"pre"!==s&&"listing"!==s){if(!n.paste||"item"===t.kind||"table"!==s)return a.has(s)?(t.open("p"),x(e.children,t,"pre"===s||"listing"===s?{...c,pre:!0}:c),void t.close()):void x(e.children,t,c);t.block(function(e,t){const n={type:"table",caption:[],rows:[]},i=(e,i)=>{const r=[];for(const n of e.children){if("element"!==n.type||"td"!==n.name&&"th"!==n.name)continue;const e=new w("item");x(n.children,e,{...t,marks:y(n,t.marks)}),e.flush(),r.push({header:"th"===n.name,leaves:S(e.blocks)})}r.length&&n.rows.push({head:i,cells:r})},r=(e,t)=>{for(const n of e.children)"element"===n.type&&"tr"===n.name&&i(n,t)};for(const s of e.children)if("element"===s.type)if("caption"===s.name){const e=new w("item");x(s.children,e,t),e.flush(),n.caption=S(e.blocks)}else"thead"===s.name?r(s,!0):"tbody"===s.name||"tfoot"===s.name?r(s,!1):"tr"===s.name&&i(s,!1);return n}(e,c))}else t.block({type:"pre",text:k(e)})}function k(e){const t=e=>"text"===e.type?e.value:o.has(e.name)?"":"br"===e.name?"\n":e.children.map(t).join("");return e.children.map(t).join("").replace(/\r\n?/gu,"\n").replace(/\u00a0/gu," ").replace(/^\n/u,"").replace(/\s+$/u,"")}function S(e){const t=[],n=e=>{if("inline"===e.type)(i=e.leaves).length&&(t.length&&t.push({kind:"br",strong:!1,em:!1,href:null}),t.push(...i));else for(const t of e.items)t.children.forEach(n);var i};return e.forEach(n),t}function T(e,t){const n=new w("item");return x(e.children,n,t),n.flush(),{children:n.blocks}}function _(e,t,n){const i={type:n,items:[]};let r=null;const s=()=>{r&&(r.flush(),i.items.push({children:r.blocks}),r=null)};for(const n of e.children)if("element"!==n.type||"li"!==n.name){if("element"===n.type&&l.has(n.name)){s();const e=_(n,{...t,marks:y(n,t.marks)},n.name);if(!e.items.length)continue;const r=i.items.at(-1);r?r.children.push(e):i.items.push({children:[e]});continue}("text"!==n.type||n.value.trim())&&("element"===n.type&&o.has(n.name)||(r??=new w("item"),$(n,r,t)))}else s(),i.items.push(T(n,t));return s(),i}const A=" ",F=(e,t)=>e.strong===t.strong&&e.em===t.em&&e.href===t.href;function C(e,t){const n=[];for(const t of e){if("text"===t.kind&&!t.value)continue;const e=n.at(-1);"text"===t.kind&&"text"===e?.kind&&F(e,t)?e.value+=t.value:n.push({...t})}for(let e=0;e<n.length;e+=1){const t=n[e];if("text"!==t.kind)continue;t.value=t.value.replace(/ {2,}/gu,A);const i=n[e-1];t.value.startsWith(A)&&(!i||"br"===i.kind||"text"===i.kind&&i.value.endsWith(A))&&(t.value=t.value.slice(1));const r=n[e+1];!t.value.endsWith(A)||r&&"br"!==r.kind||(t.value=t.value.slice(0,-1))}let i=n.filter(e=>"br"===e.kind||e.value);if("value"===t){for(;"br"===i[0]?.kind;)i.shift();for(;"br"===i.at(-1)?.kind;)i.pop();"text"===i[0]?.kind&&(i[0].value=i[0].value.replace(/^[\s\u00a0]+/u,""));const e=i.at(-1);"text"===e?.kind&&(e.value=e.value.replace(/[\s\u00a0]+$/u,"")),i=i.filter(e=>"br"===e.kind||e.value)}const r=new Map;for(const e of i)e.href&&r.set(e.href,(r.get(e.href)||"")+("text"===e.kind?e.value:"x"));for(const e of i)e.href&&!r.get(e.href).trim()&&(e.href=null);const s=[];for(const e of i){const t=s.at(-1);"text"===e.kind&&"text"===t?.kind&&F(t,e)?t.value+=e.value:s.push(e)}return s}const z=e=>e.some(e=>"text"===e.kind&&""!==e.value.replace(/[\s\u00a0]+/gu,""));function E(e,t){const n=e.items.map(e=>function(e,t){const n=[];for(const i of e.children)if("inline"===i.type){const e=C(i.leaves,t);if(!e.length)continue;const r=n.at(-1);"inline"===r?.type?r.leaves=C([...r.leaves,{kind:"br",strong:!1,em:!1,href:null},...e],t):n.push({type:"inline",leaves:e})}else{const e=E(i,t);if(!e)continue;const r=n.at(-1);r&&r.type===e.type?r.items.push(...e.items):n.push(e)}if("value"===t){const e=n.filter(e=>"inline"!==e.type||z(e.leaves));return e.length?{children:e}:null}return n.length&&"inline"===n[0].type||n.unshift({type:"inline",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}),{children:n}}(e,t)).filter(Boolean);return n.length?{type:e.type,items:n}:null}function q(e,t){const n=[];for(const i of e){let e=null;if("blockquote"===i.type){const n=q(i.blocks,t);n.length?e={type:"blockquote",blocks:n}:"editor"===t&&(e={type:"blockquote",blocks:[{type:"p",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}]})}else if(l.has(i.type))e=E(i,t);else if("pre"===i.type)i.text.trim()&&(e={type:"pre",text:i.text});else if("table"===i.type){const t=i.rows.map(e=>({head:e.head,cells:e.cells.map(e=>({header:e.header,leaves:C(e.leaves,"value")}))})).filter(e=>e.cells.some(e=>z(e.leaves)));t.length&&(e={type:"table",caption:C(i.caption,"value"),rows:t})}else{const n=C(i.leaves,t);"value"===t?z(n)&&(e={type:i.type,leaves:n}):e={type:i.type,leaves:n.length?n:[{kind:"br",strong:!1,em:!1,href:null}]}}if(!e)continue;const r=n.at(-1);r&&l.has(e.type)&&r.type===e.type?r.items.push(...e.items):n.push(e)}return n}function L(e,{mode:t="value",profile:n="html"}={}){if(!s.includes(n))throw new TypeError(`rich_text_profile_unknown: ${n}`);const i=new w("flow");x(e.children??[],i,{marks:{},href:null,pre:!1,paste:"paste"===n}),i.flush();const r=q(i.blocks,t);return"editor"!==t||r.length?r:[{type:"p",leaves:[{kind:"br",strong:!1,em:!1,href:null}]}]}const P=e=>e.replace(/&/gu,"&").replace(/"/gu,""").replace(/</gu,"<").replace(/>/gu,">").replace(/\u00a0/gu," ");function O(e){const t=(e,n)=>{let i="",r=0;const s=["href","strong","em"][n];for(;r<e.length;){const o=s?e[r][s]:null;let a=r+1;for(;a<e.length&&s&&e[a][s]===o;)a+=1;const l=e.slice(r,a);i+=s?"href"===s&&o?`<a href="${P(o)}">${t(l,n+1)}</a>`:"href"!==s&&o?`<${s}>${t(l,n+1)}</${s}>`:t(l,n+1):l.map(e=>"br"===e.kind?"<br>":e.value.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/\u00a0/gu," ")).join(""),r=a}return i};return t(e,0)}function V(e){return`<${e.type}>${e.items.map(e=>`<li>${e.children.map(e=>"inline"===e.type?O(e.leaves):V(e)).join("")}</li>`).join("")}</${e.type}>`}function I(e){return e.map(e=>{if("blockquote"===e.type)return`<blockquote>${I(e.blocks)}</blockquote>`;if(l.has(e.type))return V(e);if("pre"===e.type){return`<p>${O(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>${O(e.leaves)}</p>`).join("")}return`<${e.type}>${O(e.leaves)}</${e.type}>`}).join("")}const R=e=>{const t=e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;return"string"==typeof t?t:""};function D(e){const t=R(e);return t?function(e,{mode:t="value",document:n}={}){let i;if(e&&"object"==typeof e&&"number"==typeof e.nodeType)i=v(e);else{const t="string"==typeof e?e:"",r=void 0===n?globalThis.document:n;if(t&&r?.createElement){const e=r.createElement("template");e.innerHTML=t,i=v(e.content)}else i=m(t)}return I(L(i,{mode:t}))}(t,{mode:"value"}):""}function N(e){const t=R(e);return t?function(e){const t=L(m(e),{mode:"value"}),n=e=>e.map(e=>"br"===e.kind?"\n":e.value).join(""),i=e=>e.items.map(e=>e.children.map(e=>"inline"===e.type?n(e.leaves):i(e)).join("\n")).join("\n"),r=e=>e.map(e=>"blockquote"===e.type?r(e.blocks):l.has(e.type)?i(e):n(e.leaves)).join("\n\n");return r(t)}(t).replace(/\s+/gu," ").trim():""}},e5483002f3ea(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{oX:()=>ft,z4:()=>Xe});var r=n("2a080a730149"),s=n("073f05ff1a81"),o=n("5961360f41f4"),a=n("43090d1c8307"),l=n("fc654eb7fab0"),c=n("9ce1a42b2a85"),u=n("dd6973f77245"),d=n("eb06ad68f8d3"),p=n("ab3947ea3647"),h=e([r,s,a,p]);[r,s,a,p]=h.then?(await h)():h;function f(e){return String(e?.size||"").trim()||"1"}function g(e,t){const n=t.getFilterControlValue(e.key);return r.html`
|
|
2
2
|
<sf-input
|
|
3
|
-
size=${
|
|
3
|
+
size=${f(t)}
|
|
4
4
|
appearance="filled"
|
|
5
|
-
placeholder="${
|
|
5
|
+
placeholder="${Ne(t,"containsText")}"
|
|
6
6
|
value="${n.value||""}"
|
|
7
7
|
name="sf_filter_${e.key||"text"}"
|
|
8
8
|
@change=${i=>{t.patchTempFilterValue(e.key,{value:i.target?.value||"",operator:n.operator||e.filter?.defaultOperator||"contains"})}}
|
|
9
9
|
></sf-input>
|
|
10
|
-
`}function
|
|
10
|
+
`}function m(e,t){const n=t.getFilterControlValue(e.key),i=e.filter?.operators||["eq"],s=n.operator||e.filter?.defaultOperator||i[0],o="between"===s,a=o?n.value:Array.isArray(n.value)?n.value[0]:n.value;return r.html`
|
|
11
11
|
<div class="flex gap-1/3 flex-col">
|
|
12
12
|
<div class="sf-filter-operator-range flex gap-1/3 items-cross-center">
|
|
13
13
|
<sf-slider-range
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
></sf-slider-range>
|
|
23
23
|
</div>
|
|
24
24
|
<sf-dropdown
|
|
25
|
-
size=${
|
|
25
|
+
size=${f(t)}
|
|
26
26
|
appearance="outlined"
|
|
27
27
|
mode="select"
|
|
28
|
-
placeholder="${
|
|
28
|
+
placeholder="${Ne(t,"operator")}"
|
|
29
29
|
root-class="flex-1"
|
|
30
30
|
search="false"
|
|
31
31
|
@change=${n=>{const i=n.detail?.values?.[0]||n.detail?.value||s;t.patchTempFilterValue(e.key,{operator:i})}}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
${i.map(e=>r.html`
|
|
34
34
|
<sf-list-item
|
|
35
35
|
kind="text"
|
|
36
|
-
size=${
|
|
36
|
+
size=${f(t)}
|
|
37
37
|
text="${t.getFilterOperatorLabel(e)}"
|
|
38
38
|
value="${e}"
|
|
39
39
|
?selected=${e===s}
|
|
@@ -41,23 +41,23 @@
|
|
|
41
41
|
`)}
|
|
42
42
|
</sf-dropdown>
|
|
43
43
|
</div>
|
|
44
|
-
`}function
|
|
44
|
+
`}function v(e,t){const n=t.getFilterControlValue(e.key),i=e.filter?.operators||["eq"],s=n.operator||e.filter?.defaultOperator||i[0],o="between"===s,a=n.value,l=Array.isArray(a)?a:[a||"",""],c=(n,i)=>{if(!o)return void t.patchTempFilterValue(e.key,{value:i||"",operator:s});const r=[...l];r[n]=i||"",t.patchTempFilterValue(e.key,{value:r,operator:s})};return r.html`
|
|
45
45
|
<div class="flex gap-1/3 flex-col">
|
|
46
46
|
<div class="sf-filter-operator-inputs flex gap-1/3 items-cross-center">
|
|
47
47
|
<sf-input
|
|
48
|
-
size=${
|
|
48
|
+
size=${f(t)}
|
|
49
49
|
appearance="bordered"
|
|
50
50
|
root-class="flex-1 min-w-0"
|
|
51
|
-
label="${o?
|
|
51
|
+
label="${o?Ne(t,"rangeFrom"):t.getFilterOperatorLabel(s)}"
|
|
52
52
|
value="${o?l[0]||"":a||""}"
|
|
53
53
|
name="sf_filter_${e.key||"number"}"
|
|
54
54
|
@change=${e=>{c(0,e.target?.value)}}
|
|
55
55
|
></sf-input>
|
|
56
56
|
${o?r.html`
|
|
57
57
|
<sf-input
|
|
58
|
-
size=${
|
|
58
|
+
size=${f(t)}
|
|
59
59
|
appearance="bordered"
|
|
60
|
-
label="${
|
|
60
|
+
label="${Ne(t,"rangeTo")}"
|
|
61
61
|
root-class="flex-1 min-w-0"
|
|
62
62
|
value="${l[1]||""}"
|
|
63
63
|
name="sf_filter_${e.key||"number"}_second"
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
></sf-input>`:r.nothing}
|
|
66
66
|
</div>
|
|
67
67
|
<sf-dropdown
|
|
68
|
-
size=${
|
|
68
|
+
size=${f(t)}
|
|
69
69
|
appearance="outlined"
|
|
70
70
|
mode="select"
|
|
71
|
-
placeholder="${
|
|
71
|
+
placeholder="${Ne(t,"operator")}"
|
|
72
72
|
root-class="flex-1"
|
|
73
73
|
search="false"
|
|
74
74
|
@change=${n=>{const i=n.detail?.values?.[0]||n.detail?.value||s;t.patchTempFilterValue(e.key,{operator:i})}}
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
${i.map(e=>r.html`
|
|
77
77
|
<sf-list-item
|
|
78
78
|
kind="text"
|
|
79
|
-
size=${
|
|
79
|
+
size=${f(t)}
|
|
80
80
|
text="${t.getFilterOperatorLabel(e)}"
|
|
81
81
|
value="${e}"
|
|
82
82
|
?selected=${e===s}
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
`)}
|
|
85
85
|
</sf-dropdown>
|
|
86
86
|
</div>
|
|
87
|
-
`}function
|
|
87
|
+
`}function y(e,t){const n=t.getFilterControlValue(e.key),i=e.filter?.operators||["eq"],s=n.operator||e.filter?.defaultOperator||i[0],o="between"===s,a=o&&Array.isArray(n.value)?n.value:o?["",""]:n.value||"";return r.html`
|
|
88
88
|
<div class="flex flex-col gap-1/3">
|
|
89
89
|
<sf-input-date
|
|
90
90
|
.value=${a}
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
@change=${n=>{t.patchTempFilterValue(e.key,{value:n.detail.value,operator:s})}}
|
|
95
95
|
></sf-input-date>
|
|
96
96
|
<sf-dropdown
|
|
97
|
-
size=${
|
|
97
|
+
size=${f(t)}
|
|
98
98
|
appearance="outlined"
|
|
99
99
|
mode="select"
|
|
100
|
-
placeholder="${
|
|
100
|
+
placeholder="${Ne(t,"operator")}"
|
|
101
101
|
root-class="flex-1"
|
|
102
102
|
search="false"
|
|
103
103
|
@change=${n=>{const i=n.detail?.values?.[0]||n.detail?.value||s;t.patchTempFilterValue(e.key,{operator:i})}}
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
${i.map(e=>r.html`
|
|
106
106
|
<sf-list-item
|
|
107
107
|
kind="text"
|
|
108
|
-
size=${
|
|
108
|
+
size=${f(t)}
|
|
109
109
|
text="${t.getFilterOperatorLabel(e)}"
|
|
110
110
|
value="${e}"
|
|
111
111
|
?selected=${e===s}
|
|
@@ -113,13 +113,13 @@
|
|
|
113
113
|
`)}
|
|
114
114
|
</sf-dropdown>
|
|
115
115
|
</div>
|
|
116
|
-
`}function
|
|
116
|
+
`}function b(e,t){const n=t.getEndpointFilterPage(e),i=t.getVisibleFilterOptions(e),s=t.getFilterControlValue(e.key),o=t.getFilterOptionSearch(e.key),a=new Set(s.values||[]);return r.html`
|
|
117
117
|
<div class="flex flex-col gap-1/2 overflow-x-hidden">
|
|
118
118
|
${!e.filter?.searchable||n&&!n.searchable?"":r.html`
|
|
119
119
|
<sf-input
|
|
120
|
-
size=${
|
|
120
|
+
size=${f(t)}
|
|
121
121
|
appearance="filled"
|
|
122
|
-
placeholder="${
|
|
122
|
+
placeholder="${Ne(t,"searchInList")}"
|
|
123
123
|
value="${o}"
|
|
124
124
|
name="sf_filter_${e.key||"list"}_search"
|
|
125
125
|
@input=${n=>{t.patchTempFilterOptionSearch(e.key,n.target?.value||"")}}
|
|
@@ -135,19 +135,19 @@
|
|
|
135
135
|
<sf-empty-state layout="inline" size="1/2" kind=${o?"nothing-found":"no-data"}></sf-empty-state>`}
|
|
136
136
|
${n?r.html`
|
|
137
137
|
<div role="status" aria-live="polite" class="sf-text-1">
|
|
138
|
-
${"loading"===n.status?
|
|
138
|
+
${"loading"===n.status?Ne(t,"loadingOptions"):""}
|
|
139
139
|
</div>
|
|
140
|
-
${"error"===n.status?r.html`<sf-empty-state layout="inline" size="1/2" kind="error" text=${
|
|
140
|
+
${"error"===n.status?r.html`<sf-empty-state layout="inline" size="1/2" kind="error" text=${Ne(t,"optionsError")}
|
|
141
141
|
@sf-empty-state-action=${n=>{"retry"===n.detail?.id&&t.loadEndpointFilterPage(e,null,o)}}></sf-empty-state>`:""}
|
|
142
|
-
${n.nextCursor&&"error"!==n.status?r.html`<sf-button appearance="outline" size=${
|
|
142
|
+
${n.nextCursor&&"error"!==n.status?r.html`<sf-button appearance="outline" size=${f(t)} text="${Ne(t,"loadMore")}"
|
|
143
143
|
?disabled=${"loading"===n.status}
|
|
144
144
|
@click=${()=>t.loadEndpointFilterPage(e,n.nextCursor,o)}></sf-button>`:""}
|
|
145
145
|
`:""}
|
|
146
146
|
</div>
|
|
147
|
-
`}function
|
|
147
|
+
`}function w(e,t){return b(e,t)}function x(e,t){const n=e.filter?.options??["image","document","archive","other"].map(e=>({value:e,label:Ne(t,`fileKind_${e}`)}));return b({...e,filter:{...e.filter||{},options:n,defaultOperator:e.filter?.defaultOperator??"in"}},t)}function $(e,t){const n=e.filter?.options??(Array.isArray(e.swatches)?e.swatches:[]).map(e=>"string"==typeof e?{value:e,label:e}:e).filter(e=>e?.value).map(e=>({value:e.value,label:e.label??e.value,color:e.value}));return n.length?b({...e,filter:{...e.filter||{},options:n,optionRenderer:e.filter?.optionRenderer??"swatch",defaultOperator:e.filter?.defaultOperator??"in"}},t):g(e,t)}const k={text:g,string:g,number:v,integer:v,date:y,datetime:y,range:m,"date-range":y,"multi-select":b,"single-select":b,choice:b,choices:b,boolean:b,user:b,"entity-multi-select":w,"entity-single-select":w,record:w,relation:w,lookup:w,file:x,color:$,money:v,percent:v,items:v};function S(e={},t){const n=e.filter?.control||e.propertyType||e.type||e.dataType||"text";return(k[n]||k.text)(e,t)}const T="1/2",_="tonal",A=[[/^image\//u,"image"],[/^video\//u,"movie"],[/^audio\//u,"audiotrack"],[/^text\/(csv|tab-separated-values)$/u,"table"],[/^text\//u,"description"],[/pdf$/u,"picture_as_pdf"],[/(zip|compressed|tar|rar|7z)/u,"folder_zip"],[/(sheet|excel|spreadsheet)/u,"table"],[/(word|document)$/u,"description"],[/(presentation|powerpoint)/u,"slideshow"]];function F(e){const t=String(e||"").toLowerCase(),n=A.find(([e])=>e.test(t));return n?n[1]:"attach_file"}function C(e,t){const n=et(t);return n?r.html`
|
|
148
148
|
<sf-input-color size="1/2" appearance="plain" value=${String(n)}
|
|
149
149
|
label=${e.label||e.key||""} disabled></sf-input-color>
|
|
150
|
-
`:r.nothing}function
|
|
150
|
+
`:r.nothing}function z(e,t){const n=et(t),i=e.inheritedValue??"";return n||i?r.html`
|
|
151
151
|
<sf-input-color
|
|
152
152
|
size="1"
|
|
153
153
|
appearance="plain"
|
|
@@ -156,11 +156,11 @@
|
|
|
156
156
|
label=${e.label||e.key||""}
|
|
157
157
|
disabled
|
|
158
158
|
></sf-input-color>
|
|
159
|
-
`:r.nothing}function
|
|
159
|
+
`:r.nothing}function E(e,t,n){const i=et(t),s=e.inheritedValue??"";return r.html`
|
|
160
160
|
<sf-input-color
|
|
161
|
-
size=${
|
|
161
|
+
size=${X}
|
|
162
162
|
appearance="bordered"
|
|
163
|
-
name=${
|
|
163
|
+
name=${Z(e)}
|
|
164
164
|
value=${i?String(i):r.nothing}
|
|
165
165
|
inherited-value=${s?String(s):r.nothing}
|
|
166
166
|
swatches=${e.swatches?String(e.swatches):r.nothing}
|
|
@@ -169,11 +169,11 @@
|
|
|
169
169
|
label=${e.label||e.key||""}
|
|
170
170
|
@change=${t=>n.setFieldValue(e,t.detail?.value??"")}
|
|
171
171
|
></sf-input-color>
|
|
172
|
-
`}function
|
|
172
|
+
`}function q(e,t){return t&&"object"==typeof t&&t.label?ce(e)?L(t):{component:{type:"reference-link",props:{line:T,label:String(t.label),icon:F(t.mime),...t.href?{href:String(t.href)}:{}}}}:null}function L(e){const t=String(e.mime??e.mimeType??""),n=Boolean(e.href)&&/^image\//u.test(t);return{component:{type:"file-preview",props:{compact:!0,fileName:String(e.label),mimeType:t,icon:F(t),...e.href?{href:String(e.href)}:{},...n?{imageUrl:String(e.href),kind:"image"}:{kind:"icon"},actions:!1,downloadAction:!1,removeAction:!1}}}}function P(e,t){if(!Array.isArray(t)||!t.length)return null;if("badges"===String(e.variant??""))return O(e,t);const n=e.options||e.filter?.options||e.constraints?.options,i=e=>{const t=Array.isArray(n)?n.find(t=>String(t?.value)===String(e)):null;return String(t?.label??t?.text??e)};return t.map(e=>({component:{type:"tag",props:{line:T,kind:"default",text:i(e)}}}))}function O(e,t){const n=e.options||e.filter?.options||e.constraints?.options;return t.map(t=>{const i=t&&"object"==typeof t?t.value:t,r=Array.isArray(n)?n.find(e=>String(e?.value)===String(i)):null,s=r?(0,o.f)(r):null,a=t&&"object"==typeof t&&void 0!==t.text?String(t.text):String(r?.label??r?.text??i);return{component:{type:"badge",props:{line:T,text:a,appearance:e.badgeAppearance??_,...s?.scheme?{scheme:s.scheme}:{},...s?.rootStyle?{rootStyle:s.rootStyle}:{}}}}})}const V={string:oe,date:N,datetime:N,time:N,boolean:R,choices:P,file:q,color:C,include:pe,choice:D,integer:B,number:B,user:W,record:H,relation:H,lookup:K,html:J,money:M,percent:j,items:U};function I(e,t){return{yes:e.trueText??e.labels?.true??Ne(t,"yes"),no:e.falseText??e.labels?.false??Ne(t,"no")}}function R(e,t,n){if("boolean"!=typeof t)return null;const i=I(e,n);return t?i.yes:i.no}function D(e,t){const n=e.options||e.filter?.options||e.constraints?.options;if(!Array.isArray(n))return null;const i=n.find(e=>String(e?.value)===String(t));if(!i)return null;const r=(0,o.f)(i);return{component:{type:"badge",props:{line:T,text:i.label??i.text??String(t),appearance:e.badgeAppearance??_,...r?.scheme?{scheme:r.scheme}:{},...r?.rootStyle?{rootStyle:r.rootStyle}:{}}}}}function N(e,t,n){const i=n?.formatFieldValue?.(e,t);return"string"==typeof i&&""!==i?i:null}function M(e,t,n){const i=N(e,t,n);if(null!==i)return i;return(0,p.up)(et(t),e,(0,a.pageLocale)(n??null))||null}function j(e,t,n){const i=N(e,t,n);if(null!==i)return i;return(0,p.l9)(et(t),(0,a.pageLocale)(n??null))||null}function U(e,t,n){const i=N(e,t,n);return null!==i?i:Array.isArray(t)?t.length?(0,a.pageWord)(Re,"rowCount",n??null,{component:De,count:t.length}):"":null}function B(e,t,n){const i=e.variant||e.filter?.variant,r=Number(et(t));return"scale"===i&&Number.isFinite(r)?r<0||r>100?null:{component:{type:"progress-scale",props:{line:T,value:String(r)}}}:N(e,t,n)}function G(e){return{component:{type:"reference-link",props:{line:T,appearance:"plain",icon:"",label:String(e.label),...e.href?{href:String(e.href)}:{}}}}}function W(e,t){return t&&"object"==typeof t&&t.label?[{component:{type:"avatar",props:{line:T,text:t.avatarText||""}}},t.href?G(t):String(t.label)]:null}function H(e,t){return t&&"object"==typeof t&&t.label?G(t):null}function K(e,t){const n=je(e,t);return n.length?n.map(e=>e.label).join(", "):null}function J(e,t){return(0,d.j)(t)||null}function Y(e={},t,n){const i=e.propertyType||e.type||e.dataType,r=V[i];if(!r)return null;const s=r(e,t,n);return s??null}let X="1";const Q={record:Me,relation:Me,user:Me,lookup:Ue,string:he,text:ge,html:me,integer:xe,number:xe,date:Se,datetime:_e,time:Ae,boolean:Fe,choice:Pe,choices:Ie,file:He,color:E,include:de};function Z(e){return`sf_field_${e.key||"value"}`}function ee(e,t,n){return r.html`
|
|
173
173
|
<sf-input-country
|
|
174
|
-
size=${
|
|
175
|
-
name=${
|
|
176
|
-
value=${
|
|
174
|
+
size=${X}
|
|
175
|
+
name=${Z(e)}
|
|
176
|
+
value=${et(t)??""}
|
|
177
177
|
aria-label=${e.label||e.key||""}
|
|
178
178
|
?required=${Boolean(e.required)}
|
|
179
179
|
?disabled=${!0===e.readonly}
|
|
@@ -181,15 +181,15 @@
|
|
|
181
181
|
show-code="true"
|
|
182
182
|
@change=${t=>n.setFieldValue(e,t.detail?.value??t.target?.value??"")}
|
|
183
183
|
></sf-input-country>
|
|
184
|
-
`}function
|
|
184
|
+
`}function te(e){return"password"===String(e.variant??"")}function ne(e){return e&&"object"==typeof e&&!Array.isArray(e)?!0===e.set:"string"==typeof e&&""!==e}function ie(e,t){return Ne(e,ne(t)?"passwordSet":"passwordUnset")}function re(e,t){const n=e.currentTarget,i=n?.closest?.(".sf-field-password")?.querySelector?.("sf-input");if(!i)return;const r="text"!==i.getAttribute("input-type");i.setAttribute("input-type",r?"text":"password"),n.setAttribute("aria-label",Ne(t,r?"hidePassword":"showPassword")),n.setAttribute("icon",r?"visibility_off":"visibility")}function se(e,t,n){const i=ne(t),s=e.placeholder||(i?Ne(n,"passwordKeep"):""),o=t=>{const i=t.target?.value??"";n.setFieldValue(e,""===i?void 0:i)};return r.html`
|
|
185
185
|
<span class="sf-field-password flex items-cross-center gap-1/3 min-w-0" spellcheck="false">
|
|
186
186
|
<sf-input
|
|
187
|
-
size=${
|
|
187
|
+
size=${X}
|
|
188
188
|
appearance="bordered"
|
|
189
189
|
root-class="flex-1 min-w-0"
|
|
190
190
|
input-type="password"
|
|
191
191
|
autocomplete="new-password"
|
|
192
|
-
name=${
|
|
192
|
+
name=${Z(e)}
|
|
193
193
|
placeholder=${s||r.nothing}
|
|
194
194
|
?required=${Boolean(e.required)&&!i}
|
|
195
195
|
aria-label=${e.label||e.key||""}
|
|
@@ -197,24 +197,23 @@
|
|
|
197
197
|
@change=${o}
|
|
198
198
|
></sf-input>
|
|
199
199
|
<sf-button-icon
|
|
200
|
-
size=${
|
|
200
|
+
size=${X}
|
|
201
201
|
appearance="link"
|
|
202
202
|
scheme="on-surface"
|
|
203
203
|
icon="visibility"
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
@click=${ee}
|
|
204
|
+
aria-label=${Ne(n,"showPassword")}
|
|
205
|
+
@click=${e=>re(e,n)}
|
|
207
206
|
></sf-button-icon>
|
|
208
207
|
</span>
|
|
209
|
-
`}function
|
|
208
|
+
`}function oe(e,t,n){return te(e)?ie(n,t):null}function ae(e,t,n){return te(e)?r.html`<span class="sf-field-view">${ie(n,t)}</span>`:nt(e,t,n)}const le=new Set(["image","image-card","image-list"]);function ce(e){return le.has(String(e.variant??""))}function ue(e,t){const n=et(t);return n?r.html`
|
|
210
209
|
<pre class="sf-field-include" data-language=${e.language?String(e.language):r.nothing}><code>${String(n)}</code></pre>
|
|
211
|
-
`:r.nothing}function
|
|
210
|
+
`:r.nothing}function de(e,t,n){return r.html`
|
|
212
211
|
<sf-input-textarea
|
|
213
|
-
size=${
|
|
212
|
+
size=${X}
|
|
214
213
|
appearance="bordered"
|
|
215
214
|
class="sf-field-include-edit"
|
|
216
|
-
name=${
|
|
217
|
-
value=${
|
|
215
|
+
name=${Z(e)}
|
|
216
|
+
value=${et(t)??""}
|
|
218
217
|
rows="8"
|
|
219
218
|
spellcheck="false"
|
|
220
219
|
?required=${Boolean(e.required)}
|
|
@@ -223,11 +222,11 @@
|
|
|
223
222
|
@change=${t=>n.setFieldValue(e,t.target?.value??"")}
|
|
224
223
|
@input=${t=>n.setFieldValue(e,t.target?.value??"")}
|
|
225
224
|
></sf-input-textarea>
|
|
226
|
-
`}function
|
|
225
|
+
`}function pe(e,t){const n=et(t);if(!n)return r.nothing;const i=String(n).split("\n")[0];return r.html`<code>${i.length>60?`${i.slice(0,60)}…`:i}</code>`}function he(e,t,n){const i=(0,u.$)(e);return"phone"===String(e.variant??"")?ee(e,t,n):te(e)?se(e,t,n):i?fe(e,t,n,i):(t=et(t),r.html`
|
|
227
226
|
<sf-input
|
|
228
|
-
size=${
|
|
227
|
+
size=${X}
|
|
229
228
|
appearance="bordered"
|
|
230
|
-
name=${
|
|
229
|
+
name=${Z(e)}
|
|
231
230
|
value=${t??""}
|
|
232
231
|
placeholder=${e.placeholder||r.nothing}
|
|
233
232
|
?required=${Boolean(e.required)}
|
|
@@ -235,11 +234,11 @@
|
|
|
235
234
|
@input=${t=>n.setFieldValue(e,t.target?.value??"")}
|
|
236
235
|
@change=${t=>n.setFieldValue(e,t.target?.value??"")}
|
|
237
236
|
></sf-input>
|
|
238
|
-
`)}function
|
|
237
|
+
`)}function fe(e,t,n,i){t=et(t);const s=!1===e.nullable?"":null,o=(t,r)=>{const o=t.currentTarget,a=String(o?.value??""),l=(0,u.C)(a,i);if("incomplete"===l){const t=Ne(n,"maskIncomplete");return r&&o&&(o.setAttribute("error-message",t),o.toggleAttribute("invalid",!0)),void("function"==typeof n.setFieldError?(n.setFieldError(e,t),n.setFieldValue(e,a)):n.setFieldValue(e,void 0))}o?.hasAttribute("invalid")&&(o.toggleAttribute("invalid",!1),o.removeAttribute("error-message")),n.setFieldError?.(e,null),n.setFieldValue(e,"empty"===l?s:a)};return r.html`
|
|
239
238
|
<sf-input
|
|
240
|
-
size=${
|
|
239
|
+
size=${X}
|
|
241
240
|
appearance="bordered"
|
|
242
|
-
name=${
|
|
241
|
+
name=${Z(e)}
|
|
243
242
|
value=${t??""}
|
|
244
243
|
placeholder=${e.placeholder||r.nothing}
|
|
245
244
|
autocomplete="off"
|
|
@@ -250,11 +249,11 @@
|
|
|
250
249
|
@input=${e=>o(e,!1)}
|
|
251
250
|
@change=${e=>o(e,!0)}
|
|
252
251
|
></sf-input>
|
|
253
|
-
`}function
|
|
252
|
+
`}function ge(e,t,n){return t=et(t),r.html`
|
|
254
253
|
<sf-input-textarea
|
|
255
|
-
size=${
|
|
254
|
+
size=${X}
|
|
256
255
|
appearance="bordered"
|
|
257
|
-
name=${
|
|
256
|
+
name=${Z(e)}
|
|
258
257
|
value=${t??""}
|
|
259
258
|
placeholder=${e.placeholder||r.nothing}
|
|
260
259
|
?required=${Boolean(e.required)}
|
|
@@ -262,26 +261,26 @@
|
|
|
262
261
|
@input=${t=>n.setFieldValue(e,t.target?.value??"")}
|
|
263
262
|
@change=${t=>n.setFieldValue(e,t.target?.value??"")}
|
|
264
263
|
></sf-input-textarea>
|
|
265
|
-
`}function
|
|
264
|
+
`}function me(e,t,n){t=et(t);const i=t=>n.setFieldValue(e,t.currentTarget?.value??"");return r.html`
|
|
266
265
|
<sf-input-rich
|
|
267
|
-
size=${
|
|
266
|
+
size=${X}
|
|
268
267
|
appearance="bordered"
|
|
269
|
-
name=${
|
|
268
|
+
name=${Z(e)}
|
|
270
269
|
value=${"string"==typeof t?t:""}
|
|
271
270
|
placeholder=${e.placeholder||r.nothing}
|
|
272
271
|
?required=${Boolean(e.required)}
|
|
273
|
-
?disabled=${
|
|
272
|
+
?disabled=${Ye}
|
|
274
273
|
aria-label=${e.label||e.key||""}
|
|
275
274
|
@input=${i}
|
|
276
275
|
@change=${i}
|
|
277
276
|
></sf-input-rich>
|
|
278
|
-
`}function
|
|
277
|
+
`}function ve(e){return"stepper"===String(e.variant??"")}function ye(e){if(null==e||""===e)return"";const t=Number(e);return Number.isFinite(t)?String(t):""}function be(e,t,n){const i="number"===(e.propertyType||e.type),s=ye(e.step),o=i?ye(e.precision)||(s?"":"2"):"0",a=t=>n.setFieldValue(e,t.detail?.value??null);return r.html`
|
|
279
278
|
<sf-input-quantity
|
|
280
|
-
size=${
|
|
281
|
-
name=${
|
|
282
|
-
value=${
|
|
283
|
-
min=${
|
|
284
|
-
max=${
|
|
279
|
+
size=${X}
|
|
280
|
+
name=${Z(e)}
|
|
281
|
+
value=${ye(et(t))}
|
|
282
|
+
min=${ye(e.min)||r.nothing}
|
|
283
|
+
max=${ye(e.max)||r.nothing}
|
|
285
284
|
step=${s||r.nothing}
|
|
286
285
|
precision=${o||r.nothing}
|
|
287
286
|
aria-label=${e.label||e.key||""}
|
|
@@ -290,33 +289,45 @@
|
|
|
290
289
|
@input=${a}
|
|
291
290
|
@change=${a}
|
|
292
291
|
></sf-input-quantity>
|
|
293
|
-
`}function
|
|
292
|
+
`}function we(e,t){return"number"===(e.propertyType||e.type)&&("string"==typeof t||Number.isInteger(e.precision))}function xe(e,t,n){if(ve(e))return be(e,t,n);const i="number"===(e.propertyType||e.type);if(t=et(t),!i)return r.html`
|
|
293
|
+
<sf-input
|
|
294
|
+
size=${X}
|
|
295
|
+
appearance="bordered"
|
|
296
|
+
name=${Z(e)}
|
|
297
|
+
value=${t??""}
|
|
298
|
+
inputmode="numeric"
|
|
299
|
+
?required=${Boolean(e.required)}
|
|
300
|
+
aria-label=${e.label||e.key||""}
|
|
301
|
+
@input=${t=>{const i=t.target?.value??"";n.setFieldValue(e,""===i?null:Number(i))}}
|
|
302
|
+
@change=${t=>{const i=t.target?.value??"";n.setFieldValue(e,""===i?null:Number(i))}}
|
|
303
|
+
></sf-input>
|
|
304
|
+
`;const s=we(e,t),o=(t,i)=>{const r=t.currentTarget??t.target,o=String(r?.value??""),l=(0,p.e4)(o);let c=null;if(l.ok?null!==l.value&&Number.isInteger(e.precision)&&(0,p.PD)(l.value)>e.precision&&(c=(0,a.pageWord)(Re,"precisionMax",n??null,{component:De,count:e.precision})):c=Ne(n,"notNumber"),c)return i&&r&&(r.setAttribute("error-message",c),r.toggleAttribute("invalid",!0)),void("function"==typeof n.setFieldError?(n.setFieldError(e,c),n.setFieldValue(e,o)):n.setFieldValue(e,void 0));r?.hasAttribute?.("invalid")&&(r.toggleAttribute("invalid",!1),r.removeAttribute("error-message")),n.setFieldError?.(e,null),null===l.value?n.setFieldValue(e,null):n.setFieldValue(e,s?l.value:Number(l.value))};return r.html`
|
|
294
305
|
<sf-input
|
|
295
|
-
size=${
|
|
306
|
+
size=${X}
|
|
296
307
|
appearance="bordered"
|
|
297
|
-
name=${
|
|
308
|
+
name=${Z(e)}
|
|
298
309
|
value=${t??""}
|
|
299
|
-
inputmode
|
|
310
|
+
inputmode="decimal"
|
|
300
311
|
?required=${Boolean(e.required)}
|
|
301
312
|
aria-label=${e.label||e.key||""}
|
|
302
|
-
@input=${
|
|
303
|
-
@change=${
|
|
313
|
+
@input=${e=>o(e,!1)}
|
|
314
|
+
@change=${e=>o(e,!0)}
|
|
304
315
|
></sf-input>
|
|
305
|
-
`}const
|
|
316
|
+
`}const $e=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?)(Z|[+-]\d{2}:?\d{2})?$/;function ke(e){const t="string"==typeof e?e.trim().match($e):null;return t?{date:t[1],suffix:`T${t[2]}${t[3]||""}`}:{date:e,suffix:""}}function Se(e,t,n){t=et(t);const{date:i,suffix:s}=ke(t);return r.html`
|
|
306
317
|
<sf-input-date
|
|
307
|
-
size=${
|
|
308
|
-
name=${
|
|
318
|
+
size=${X}
|
|
319
|
+
name=${Z(e)}
|
|
309
320
|
value=${i??""}
|
|
310
321
|
aria-label=${e.label||e.key||""}
|
|
311
322
|
?required=${Boolean(e.required)}
|
|
312
323
|
@change=${t=>{const i=t.detail?.value??t.target?.value??null;n.setFieldValue(e,i&&s?`${i}${s}`:i)}}
|
|
313
324
|
></sf-input-date>
|
|
314
|
-
`}function
|
|
325
|
+
`}function Te(e){const t=Number(e.step);return Number.isInteger(t)&&t>=1&&t<=60?String(t):""}function _e(e,t,n){const i=(0,c.AC)(t),s=i.date?`${i.date}${i.time?`T${i.time}`:""}`:"",o="string"==typeof e.min?e.min:"",a="string"==typeof e.max?e.max:"",l=Te(e);return r.html`
|
|
315
326
|
<sf-input-date
|
|
316
327
|
class="sf-field-datetime"
|
|
317
328
|
mode="datetime"
|
|
318
|
-
size=${
|
|
319
|
-
name=${
|
|
329
|
+
size=${X}
|
|
330
|
+
name=${Z(e)}
|
|
320
331
|
.value=${s}
|
|
321
332
|
min-date=${o||r.nothing}
|
|
322
333
|
max-date=${a||r.nothing}
|
|
@@ -325,12 +336,12 @@
|
|
|
325
336
|
?required=${Boolean(e.required)}
|
|
326
337
|
@change=${t=>{if(t.target!==t.currentTarget)return;const[r="",s=""]=String(t.detail?.value??"").split("T"),o=(0,c.cy)(i,{date:r,time:s});if(o.error)return;const a=null===o.value?i.known&&!i.date:o.value===i.raw;n.setFieldValue(e,a?void 0:o.value)}}
|
|
327
338
|
></sf-input-date>
|
|
328
|
-
`}function
|
|
339
|
+
`}function Ae(e,t,n){const i=(0,c.SB)(t),s="string"==typeof e.min?e.min:"",o="string"==typeof e.max?e.max:"",a=Te(e);return r.html`
|
|
329
340
|
<sf-input-date
|
|
330
341
|
class="sf-field-time"
|
|
331
342
|
mode="time"
|
|
332
|
-
size=${
|
|
333
|
-
name=${
|
|
343
|
+
size=${X}
|
|
344
|
+
name=${Z(e)}
|
|
334
345
|
.value=${i.time}
|
|
335
346
|
min-time=${s||r.nothing}
|
|
336
347
|
max-time=${o||r.nothing}
|
|
@@ -339,29 +350,29 @@
|
|
|
339
350
|
?required=${Boolean(e.required)}
|
|
340
351
|
@change=${t=>{if(t.target!==t.currentTarget)return;const r=(0,c.MC)(i,String(t.detail?.value??""));if(r.error)return;const s=null===r.value?i.known&&!i.time:r.value===i.raw;n.setFieldValue(e,s?void 0:r.value)}}
|
|
341
352
|
></sf-input-date>
|
|
342
|
-
`}function
|
|
353
|
+
`}function Fe(e,t,n){if(!(!0!==e.required))return r.html`
|
|
343
354
|
<sf-switch
|
|
344
|
-
size=${
|
|
345
|
-
name=${
|
|
355
|
+
size=${X}
|
|
356
|
+
name=${Z(e)}
|
|
346
357
|
?checked=${!0===t}
|
|
347
358
|
aria-label=${e.label||e.key||""}
|
|
348
359
|
@change=${t=>n.setFieldValue(e,Boolean(t.target?.checked))}
|
|
349
360
|
></sf-switch>
|
|
350
|
-
`;const i=
|
|
361
|
+
`;const i=I(e,n),s=JSON.stringify([{value:"yes",label:i.yes},{value:"no",label:i.no}]);return r.html`
|
|
351
362
|
<sf-button-group
|
|
352
|
-
size=${
|
|
363
|
+
size=${X}
|
|
353
364
|
items=${s}
|
|
354
365
|
value=${!0===t?"yes":!1===t?"no":r.nothing}
|
|
355
366
|
aria-label=${e.label||e.key||""}
|
|
356
367
|
@change=${t=>{const i=t.detail?.value;n.setFieldValue(e,"yes"===i||"no"!==i&&null)}}
|
|
357
368
|
></sf-button-group>
|
|
358
|
-
`}function
|
|
369
|
+
`}function Ce(e,t,n){const i=e.options||e.filter?.options||e.constraints?.options||[],r=n?new Set((Array.isArray(t)?t:[]).map(e=>String(e))):new Set([String(t??"")]);return i.map(e=>({type:"text",size:"1",text:e.label??e.text??String(e.value),value:String(e.value),selected:r.has(String(e.value))}))}const ze=new Set(["1/2","1","2"]),Ee=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"," ","Enter"]);function qe(e){return"buttons"===String(e.variant??"")}function Le(e,t,n){t=et(t);const i=(e.options||e.filter?.options||e.constraints?.options||[]).filter(e=>e&&null!==e.value&&void 0!==e.value&&""!==String(e.value)),s=i.map(e=>({value:String(e.value),label:String(e.label??e.text??e.value),...e.icon?{icon:String(e.icon)}:{},...e.disabled?{disabled:!0}:{}})),o=String(e.size??""),a=ze.has(o)?o:X,l=Ye,c=!l&&!0===e.readonly,u=!0!==e.required&&!c&&!l,d=null==t?"":String(t),p={capture:!0,handleEvent(e){const t=e.currentTarget,n=e.target?.closest?.("[data-sf-button-group-value]");if(t&&n&&t.contains(n))return c?(e.preventDefault(),void e.stopPropagation()):void(u&&!n.disabled&&n.getAttribute("data-sf-button-group-value")===t.value&&(e.preventDefault(),e.stopPropagation(),t.clear?.()))}},h={capture:!0,handleEvent(e){c&&Ee.has(e.key)&&(e.preventDefault(),e.stopPropagation())}};return r.html`
|
|
359
370
|
<sf-button-group
|
|
360
371
|
class="sf-field-choice-buttons"
|
|
361
372
|
appearance="segmented"
|
|
362
373
|
size=${a}
|
|
363
374
|
root-class=${c?"flex-wrap pointer-event-none":"flex-wrap"}
|
|
364
|
-
name=${
|
|
375
|
+
name=${Z(e)}
|
|
365
376
|
items=${JSON.stringify(s)}
|
|
366
377
|
value=${d||r.nothing}
|
|
367
378
|
?disabled=${l}
|
|
@@ -371,55 +382,55 @@
|
|
|
371
382
|
@keydown=${h}
|
|
372
383
|
@change=${t=>{const r=String(t.detail?.value??"");var s;n.setFieldValue(e,""===r?null:(s=r,i.find(e=>String(e.value)===s)?.value??s))}}
|
|
373
384
|
></sf-button-group>
|
|
374
|
-
`}function
|
|
385
|
+
`}function Pe(e,t,n){return qe(e)?Le(e,t,n):(t=et(t),r.html`
|
|
375
386
|
<sf-dropdown
|
|
376
|
-
size=${
|
|
387
|
+
size=${X}
|
|
377
388
|
appearance="outlined"
|
|
378
389
|
mode="select"
|
|
379
390
|
search="false"
|
|
380
|
-
name=${
|
|
391
|
+
name=${Z(e)}
|
|
381
392
|
?required=${Boolean(e.required)}
|
|
382
393
|
value=${t??""}
|
|
383
394
|
placeholder=${e.placeholder||r.nothing}
|
|
384
395
|
aria-label=${e.label||e.key||""}
|
|
385
|
-
.options=${
|
|
396
|
+
.options=${Ce(e,t,!1)}
|
|
386
397
|
@change=${t=>n.setFieldValue(e,t.detail?.value??null)}
|
|
387
398
|
></sf-dropdown>
|
|
388
|
-
`)}const
|
|
399
|
+
`)}const Oe=13;function Ve(e,t,n){const i=e.options||e.filter?.options||e.constraints?.options||[],s=new Set((Array.isArray(t)?t:[]).map(e=>String(e)));return r.html`
|
|
389
400
|
<div class="sf-field-checklist grid gap-1/3 w-full min-w-0" role="group" aria-label=${e.label||e.key||""}
|
|
390
401
|
style="grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr))">
|
|
391
|
-
${i.map(t=>r.html`<sf-checkbox size=${
|
|
392
|
-
name=${
|
|
402
|
+
${i.map(t=>r.html`<sf-checkbox size=${X}
|
|
403
|
+
name=${Z(e)} value=${String(t.value)}
|
|
393
404
|
label=${t.label??t.text??String(t.value)}
|
|
394
405
|
.checked=${s.has(String(t.value))}
|
|
395
406
|
@change=${r=>((t,r)=>{const o=i.filter(e=>String(e.value)===String(t.value)?r:s.has(String(e.value))).map(e=>e.value);n.setFieldValue(e,o)})(t,Boolean(r.target?.checked??r.detail?.checked))}></sf-checkbox>`)}
|
|
396
407
|
</div>
|
|
397
|
-
`}function
|
|
408
|
+
`}function Ie(e,t,n){const i=e.options||e.filter?.options||e.constraints?.options||[],s=String(e.variant??"");return"checklist"===s||"select"!==s&&i.length>=Oe?Ve(e,t,n):r.html`
|
|
398
409
|
<sf-dropdown
|
|
399
|
-
size=${
|
|
410
|
+
size=${X}
|
|
400
411
|
appearance="outlined"
|
|
401
412
|
mode="select"
|
|
402
413
|
multiple
|
|
403
414
|
search="false"
|
|
404
|
-
name=${
|
|
415
|
+
name=${Z(e)}
|
|
405
416
|
?required=${Boolean(e.required)}
|
|
406
417
|
placeholder=${e.placeholder||r.nothing}
|
|
407
418
|
aria-label=${e.label||e.key||""}
|
|
408
|
-
.options=${
|
|
419
|
+
.options=${Ce(e,t,!0)}
|
|
409
420
|
@change=${t=>{const i=t.detail?.values??t.detail?.value;n.setFieldValue(e,Array.isArray(i)?i:i?[i]:[])}}
|
|
410
421
|
></sf-dropdown>
|
|
411
|
-
`}const
|
|
422
|
+
`}const Re={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",hidePassword:"Hide password",maskIncomplete:"Complete the field",notNumber:"Enter a number",precisionMax:"At most {n} digits after the point",rowCount:{one:"{n} row",other:"{n} rows"}},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:"Показать пароль",hidePassword:"Скрыть пароль",maskIncomplete:"Заполните поле полностью",notNumber:"Введите число",precisionMax:"Не больше {n} знаков после запятой",rowCount:{one:"{n} строка",few:"{n} строки",many:"{n} строк",other:"{n} строки"}}},De="sf-field-renderers";function Ne(e,t){return e?.getFieldText?.(t)??(0,a.pageText)(Re,t,e??null,De)}function Me(e,t,n){if(!n.loadFieldOptions||!n.getFieldOptionsPage)return null;const i=n.getFieldOptionsPage(e)||null;if("unsupported"===i?.status)return null;const s=n.getFieldOptionSearch?.(e)??"",o=t&&"object"==typeof t?t:null,a=Array.isArray(i?.items)?i.items:[],l=[...o&&!a.some(e=>String(e.value)===String(o.value))?[o]:[],...a].map(e=>({type:"text",size:"1",text:String(e.label??e.value),value:String(e.value),selected:Boolean(o&&String(o.value)===String(e.value))}));return r.html`
|
|
412
423
|
<div class="sf-field-picker flex flex-col gap-1/3" data-field-picker=${e.key||r.nothing}>
|
|
413
424
|
<sf-dropdown
|
|
414
|
-
size=${
|
|
425
|
+
size=${X}
|
|
415
426
|
appearance="outlined"
|
|
416
427
|
mode="select"
|
|
417
428
|
search="true"
|
|
418
|
-
name=${
|
|
429
|
+
name=${Z(e)}
|
|
419
430
|
?required=${Boolean(e.required)}
|
|
420
431
|
value=${o?String(o.value):""}
|
|
421
|
-
placeholder=${e.placeholder||
|
|
422
|
-
search-placeholder=${e.searchPlaceholder||
|
|
432
|
+
placeholder=${e.placeholder||Ne(n,"pickRecord")}
|
|
433
|
+
search-placeholder=${e.searchPlaceholder||Ne(n,"searchRecords")}
|
|
423
434
|
aria-label=${e.label||e.key||""}
|
|
424
435
|
.options=${l}
|
|
425
436
|
@change=${t=>(t=>{if(!t)return void n.setFieldValue(e,null);const i=[o,...a].find(e=>e&&String(e.value)===String(t));n.setFieldValue(e,i?{value:i.value,label:i.label}:{value:t})})(t.detail?.value??null)}
|
|
@@ -428,15 +439,15 @@
|
|
|
428
439
|
${i?r.html`
|
|
429
440
|
<div class="sf-field-picker-state flex items-cross-center gap-1/3">
|
|
430
441
|
<div role="status" aria-live="polite" class="sf-text-1">
|
|
431
|
-
${"loading"!==i.status||i.quiet?"error"===i.status?
|
|
442
|
+
${"loading"!==i.status||i.quiet?"error"===i.status?Ne(n,"recordsError"):"":Ne(n,"loadingRecords")}
|
|
432
443
|
</div>
|
|
433
444
|
${"error"===i.status?r.html`
|
|
434
|
-
<sf-button appearance="outline" size="1" text=${
|
|
445
|
+
<sf-button appearance="outline" size="1" text=${Ne(n,"retry")}
|
|
435
446
|
@click=${()=>n.loadFieldOptions(e,{cursor:null,search:s})}
|
|
436
447
|
></sf-button>
|
|
437
448
|
`:r.nothing}
|
|
438
449
|
${i.nextCursor&&"error"!==i.status?r.html`
|
|
439
|
-
<sf-button appearance="outline" size="1" text=${
|
|
450
|
+
<sf-button appearance="outline" size="1" text=${Ne(n,"loadMore")}
|
|
440
451
|
?disabled=${"loading"===i.status}
|
|
441
452
|
@click=${()=>n.loadFieldOptions(e,{cursor:i.nextCursor,search:s})}
|
|
442
453
|
></sf-button>
|
|
@@ -444,19 +455,19 @@
|
|
|
444
455
|
</div>
|
|
445
456
|
`:r.nothing}
|
|
446
457
|
</div>
|
|
447
|
-
`}function
|
|
458
|
+
`}function je(e,t){const n=Array.isArray(t)?t:[t],i=Array.isArray(e.options)?e.options:[];return n.filter(e=>null!=e&&""!==e).map(e=>{if("object"==typeof e)return{value:e.value,label:String(e.label??e.value??"")};const t=i.find(t=>String(t?.value)===String(e));return{value:e,label:String(t?.label??t?.text??e)}})}function Ue(e,t,n){const i=!0===e.multiple,s=Array.isArray(e.options)&&e.options.length>0;if(!(s||n.loadFieldOptions&&n.getFieldOptionsPage))return null;const o=s?null:n.getFieldOptionsPage(e)||null;if("unsupported"===o?.status)return null;const a=s?"":n.getFieldOptionSearch?.(e)??"",l=je(e,t),c=(s?e.options:Array.isArray(o?.items)?o.items:[]).filter(e=>e&&"object"==typeof e).map(e=>({value:e.value,label:String(e.label??e.text??e.value)})),u=e=>l.some(t=>String(t.value)===String(e.value)),d=[...l.filter(e=>!c.some(t=>String(t.value)===String(e.value))),...c].map(e=>({type:"text",size:"1",text:e.label,value:String(e.value),selected:u(e)})),p=[...l,...c],h=e=>{const t=p.find(t=>String(t.value)===String(e));return t?{value:t.value,label:t.label}:{value:e,label:String(e)}};return r.html`
|
|
448
459
|
<div class="sf-field-picker flex flex-col gap-1/3" data-field-picker=${e.key||r.nothing}>
|
|
449
460
|
<sf-dropdown
|
|
450
|
-
size=${
|
|
461
|
+
size=${X}
|
|
451
462
|
appearance="outlined"
|
|
452
463
|
mode="select"
|
|
453
464
|
?multiple=${i}
|
|
454
465
|
search="true"
|
|
455
|
-
name=${
|
|
466
|
+
name=${Z(e)}
|
|
456
467
|
?required=${Boolean(e.required)}
|
|
457
468
|
value=${i?r.nothing:l[0]?String(l[0].value):""}
|
|
458
|
-
placeholder=${e.placeholder||
|
|
459
|
-
search-placeholder=${e.searchPlaceholder||
|
|
469
|
+
placeholder=${e.placeholder||Ne(n,"pickFromList")}
|
|
470
|
+
search-placeholder=${e.searchPlaceholder||Ne(n,"searchInList")}
|
|
460
471
|
aria-label=${e.label||e.key||""}
|
|
461
472
|
.options=${d}
|
|
462
473
|
@change=${t=>{if(i){const i=t.detail?.values??t.detail?.value,r=(Array.isArray(i)?i:i?[i]:[]).filter(e=>""!==e);return void n.setFieldValue(e,r.map(h))}const r=t.detail?.value??null;n.setFieldValue(e,null===r||""===r?null:h(r))}}
|
|
@@ -465,15 +476,15 @@
|
|
|
465
476
|
${o?r.html`
|
|
466
477
|
<div class="sf-field-picker-state flex items-cross-center gap-1/3">
|
|
467
478
|
<div role="status" aria-live="polite" class="sf-text-1">
|
|
468
|
-
${"loading"!==o.status||o.quiet?"error"===o.status?
|
|
479
|
+
${"loading"!==o.status||o.quiet?"error"===o.status?Ne(n,"optionsError"):"":Ne(n,"loadingOptions")}
|
|
469
480
|
</div>
|
|
470
481
|
${"error"===o.status?r.html`
|
|
471
|
-
<sf-button appearance="outline" size="1" text=${
|
|
482
|
+
<sf-button appearance="outline" size="1" text=${Ne(n,"retry")}
|
|
472
483
|
@click=${()=>n.loadFieldOptions(e,{cursor:null,search:a})}
|
|
473
484
|
></sf-button>
|
|
474
485
|
`:r.nothing}
|
|
475
486
|
${o.nextCursor&&"error"!==o.status?r.html`
|
|
476
|
-
<sf-button appearance="outline" size="1" text=${
|
|
487
|
+
<sf-button appearance="outline" size="1" text=${Ne(n,"loadMore")}
|
|
477
488
|
?disabled=${"loading"===o.status}
|
|
478
489
|
@click=${()=>n.loadFieldOptions(e,{cursor:o.nextCursor,search:a})}
|
|
479
490
|
></sf-button>
|
|
@@ -481,10 +492,10 @@
|
|
|
481
492
|
</div>
|
|
482
493
|
`:r.nothing}
|
|
483
494
|
</div>
|
|
484
|
-
`}function
|
|
495
|
+
`}function Be(e){return Array.isArray(e)?e.filter(e=>e&&"object"==typeof e):e&&"object"==typeof e?[e]:[]}function Ge(e,t){return"image"===String(e.variant??"")&&!0!==e.multiple&&Be(t).length<=1}function We(e,t,n){const i=Be(t)[0]??null,s=Array.isArray(t);return r.html`
|
|
485
496
|
<sf-input-image
|
|
486
|
-
size=${
|
|
487
|
-
name=${
|
|
497
|
+
size=${X}
|
|
498
|
+
name=${Z(e)}
|
|
488
499
|
accept=${e.accept?String(e.accept):r.nothing}
|
|
489
500
|
hint=${e.uploadSupportingText||r.nothing}
|
|
490
501
|
.value=${i}
|
|
@@ -493,26 +504,26 @@
|
|
|
493
504
|
?disabled=${!0===e.readonly}
|
|
494
505
|
@change=${t=>{const i=t.detail?.value??null;n.setFieldValue(e,s?i?[i]:[]:i);const r=t.detail?.file;r&&n.startFieldUpload&&n.startFieldUpload(e,[{name:r.name,state:"process",progress:0,file:r}])}}
|
|
495
506
|
></sf-input-image>
|
|
496
|
-
`}function
|
|
507
|
+
`}function He(e,t,n){if(Ge(e,t))return We(e,t,n);const i=Be(t),s=!0===e.multiple||Array.isArray(t),o=Boolean(n.startFieldUpload&&n.getFieldUploads),a=o?n.getFieldUploads(e):null,l=Array.isArray(a)?a:[];return r.html`
|
|
497
508
|
<div class="sf-field-file flex flex-col">
|
|
498
509
|
${i.map((t,o)=>r.html`
|
|
499
510
|
<sf-file-preview
|
|
500
511
|
file-name=${String(t.label??t.name??"File")}
|
|
501
512
|
file-size=${String(t.size??"")}
|
|
502
|
-
icon=${
|
|
513
|
+
icon=${F(t.mime??t.mimeType)}
|
|
503
514
|
mime-type=${String(t.mime??t.mimeType??"")}
|
|
504
515
|
href=${t.href?String(t.href):r.nothing}
|
|
505
516
|
download-action=${t.href?"true":"false"}
|
|
506
517
|
remove-action="true"
|
|
507
|
-
remove-label=${`${
|
|
518
|
+
remove-label=${`${Ne(n,"removeFile")} ${t.label??t.name??""}`.trim()}
|
|
508
519
|
@sf-file-preview-detach=${()=>(t=>{const r=i.filter((e,n)=>n!==t);n.setFieldValue(e,s?r:r[0]??null)})(o)}
|
|
509
520
|
></sf-file-preview>
|
|
510
521
|
`)}
|
|
511
522
|
|
|
512
523
|
${o?r.html`
|
|
513
524
|
<sf-file-upload
|
|
514
|
-
size=${
|
|
515
|
-
name=${
|
|
525
|
+
size=${X}
|
|
526
|
+
name=${Z(e)}
|
|
516
527
|
accept=${String(e.accept??"")}
|
|
517
528
|
formats=${String(e.formats??"")}
|
|
518
529
|
link-text=${e.uploadText||r.nothing}
|
|
@@ -527,43 +538,44 @@
|
|
|
527
538
|
></sf-file-upload>
|
|
528
539
|
`:r.nothing}
|
|
529
540
|
</div>
|
|
530
|
-
`}const
|
|
541
|
+
`}const Ke=e=>"1/2"===e?.size?"1/2":"1",Je=(e,t)=>"choice"===e&&qe(t);let Ye=!1;function Xe(e={},t,n,i={}){const r=e.propertyType||e.type||e.dataType,s=!0===i?.disabled;if((!0===e.readonly||s)&&ht[r]&&!Je(r,e))return ft(e,t,n,i);const o=Q[r];if(!o||!n?.setFieldValue)return null;const a=X,l=Ye;X=Ke(i),Ye=s;try{return o(e,t,n)}finally{X=a,Ye=l}}let Qe="1";function Ze(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)&&"string"==typeof e.text}function et(e){return Ze(e)?e.value:e}function tt(e,t,n){const i=n?.formatFieldValue?.(e,t);if("string"==typeof i)return i;if(Ze(t))return t.text;const r=et(t);return null==r?"":String(r)}function nt(e,t,n){const i=tt(e,t,n);return i?r.html`<span class="sf-field-view">${i}</span>`:r.nothing}function it(e,t){const n=(0,d.b)(t);return n?r.html`<div class="sf-field-view sf-field-html">${(0,s.unsafeHTML)(n)}</div>`:r.nothing}function rt(e,t,n){if(null==t||""===t)return r.nothing;const i=e.variant||e.filter?.variant,s=Number(et(t));if("scale"===i&&Number.isFinite(s)&&s>=0&&s<=100)return r.html`<sf-progress-scale size="1" value=${String(s)}></sf-progress-scale>`;const o=tt(e,t,n);return r.html`<span class="sf-field-view">${e.unit?`${o} ${e.unit}`:o}</span>`}function st(e,t,n){const i=tt(e,t,n);return i?r.html`<span class="sf-field-view">${i}</span>`:r.nothing}function ot(e,t,n){if("boolean"!=typeof t)return r.nothing;const i=I(e,n);return r.html`<span class="sf-field-view">${t?i.yes:i.no}</span>`}function at(e,t){const n=e.options||e.filter?.options||e.constraints?.options,i=Array.isArray(n)?n.find(e=>String(e?.value)===String(t)):null;if(!i)return r.nothing;const s=(0,o.f)(i);return r.html`
|
|
531
542
|
<sf-badge
|
|
532
|
-
line=${
|
|
533
|
-
|
|
543
|
+
line=${Qe}
|
|
544
|
+
tight
|
|
545
|
+
appearance=${e.badgeAppearance??_}
|
|
534
546
|
scheme=${s.scheme}
|
|
535
547
|
style=${s.rootStyle||r.nothing}
|
|
536
548
|
text=${String(i.label??i.text??t)}
|
|
537
549
|
></sf-badge>
|
|
538
|
-
`}function
|
|
550
|
+
`}function lt(e,t){if(!Array.isArray(t)||!t.length)return r.nothing;const n=e.options||e.filter?.options||e.constraints?.options;return r.html`
|
|
539
551
|
<span class="sf-field-view flex flex-wrap items-cross-center gap-1/3 min-w-0">
|
|
540
|
-
${t.map(e=>r.html`<sf-tag root-class="flex-none" line=${
|
|
552
|
+
${t.map(e=>r.html`<sf-tag root-class="flex-none" line=${Qe} kind="default" text=${(e=>{const t=Array.isArray(n)?n.find(t=>String(t?.value)===String(e)):null;return String(t?.label??t?.text??e)})(e)}></sf-tag>`)}
|
|
541
553
|
</span>
|
|
542
|
-
`}function
|
|
554
|
+
`}function ct(e,t){return t&&"object"==typeof t&&t.label?r.html`
|
|
543
555
|
<span class="sf-field-view flex items-cross-center gap-1/3">
|
|
544
|
-
<sf-avatar line=${
|
|
545
|
-
${t.href?r.html`<sf-reference-link appearance="plain" icon="" line=${
|
|
556
|
+
<sf-avatar line=${Qe} text=${t.avatarText||""}></sf-avatar>
|
|
557
|
+
${t.href?r.html`<sf-reference-link appearance="plain" icon="" line=${Qe}
|
|
546
558
|
label=${String(t.label)} href=${String(t.href)}></sf-reference-link>`:r.html`<span>${String(t.label)}</span>`}
|
|
547
559
|
</span>
|
|
548
|
-
`:r.nothing}function
|
|
560
|
+
`:r.nothing}function ut(e,t){return t&&"object"==typeof t&&t.label?r.html`
|
|
549
561
|
<sf-reference-link
|
|
550
562
|
appearance="plain"
|
|
551
563
|
icon=""
|
|
552
|
-
line=${
|
|
564
|
+
line=${Qe}
|
|
553
565
|
label=${String(t.label)}
|
|
554
566
|
href=${t.href?String(t.href):r.nothing}
|
|
555
567
|
></sf-reference-link>
|
|
556
|
-
`:r.nothing}function
|
|
568
|
+
`:r.nothing}function dt(e,t){const n=je(e,t);return n.length?1===n.length&&!0!==e.multiple?r.html`<span class="sf-field-view">${n[0].label}</span>`:r.html`
|
|
557
569
|
<span class="sf-field-view flex flex-wrap items-cross-center gap-1/3 min-w-0">
|
|
558
|
-
${n.map(e=>r.html`<sf-tag root-class="flex-none" line=${
|
|
570
|
+
${n.map(e=>r.html`<sf-tag root-class="flex-none" line=${Qe} kind="default" text=${e.label}></sf-tag>`)}
|
|
559
571
|
</span>
|
|
560
|
-
`:r.nothing}function
|
|
572
|
+
`:r.nothing}function pt(e,t){const n=Be(t);if(!n.length)return r.nothing;const i=ce(e),s="image-card"===String(e.variant??"");return r.html`
|
|
561
573
|
<span class="sf-field-view flex ${s?"flex-row":"flex-col"} gap-1/3">
|
|
562
574
|
${n.map(e=>r.html`
|
|
563
575
|
<sf-file-preview
|
|
564
576
|
file-name=${String(e.label??e.name??"File")}
|
|
565
577
|
file-size=${String(e.size??"")}
|
|
566
|
-
icon=${
|
|
578
|
+
icon=${F(e.mime??e.mimeType)}
|
|
567
579
|
mime-type=${String(e.mime??e.mimeType??"")}
|
|
568
580
|
href=${e.href?String(e.href):r.nothing}
|
|
569
581
|
image-url=${i&&e.href?String(e.href):r.nothing}
|
|
@@ -573,10 +585,10 @@
|
|
|
573
585
|
></sf-file-preview>
|
|
574
586
|
`)}
|
|
575
587
|
</span>
|
|
576
|
-
`}const lt={string:ie,text:Xe,html:Ze,integer:Qe,number:Qe,date:et,datetime:et,time:et,boolean:tt,choice:nt,choices:it,user:rt,record:st,relation:st,lookup:ot,file:at,color:C,include:oe};function ct(e={},t,n,i={}){const r=e.propertyType||e.type||e.dataType,s=lt[r];if(!s)return null;const o=He;He=Ue(i);try{return s(e,t,n)}finally{He=o}}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.fieldRenderers={...window.SF.fieldRenderers||{},renderCellField:W,renderEditField:We,renderFilterField:k,renderViewField:ct,FILTER_RENDERERS:$,dateTime:{split:c.AC,compose:c.cy,normalizeTime:c.d2,splitTime:c.SB,composeTime:c.MC},registry:l.u.map(e=>{return{...e,modes:(t=e.type,(0,l.U)(t,{view:lt,edit:K,cell:P,filter:$}))};var t})},globalThis.document?.dispatchEvent?.(new CustomEvent("sf-field-renderers-ready"))),i()}catch(ut){i(ut)}})},dd6973f77245(e,t,n){n.d(t,{$:()=>a,C:()=>l});const i={0:"\\d",a:"\\p{L}","*":"[\\s\\S]"},r={0:e=>/\d/u.test(e),a:e=>/\p{L}/u.test(e),"*":()=>!0},s=e=>e.replace(/[\\^$.*+?()[\]{}|/]/gu,"\\$&");const o=new Map;function a(e){const t=e?.mask;return"string"==typeof t&&""!==t?t:null}function l(e,t,n="_"){const a=String(e??"");o.has(t)||o.set(t,function(e){let t="";const n=[];for(let o=0;o<e.length;o+=1){const a=e[o];"\\"===a?(o+=1,o<e.length&&(t+=s(e[o]),n.push({fixed:e[o]}))):"{"===a||"}"===a||"["===a||"]"===a||(i[a]?(t+=i[a],n.push({test:r[a]})):(t+=s(a),n.push({fixed:a})))}return{complete:new RegExp(`^${t}$`,"u"),tokens:n}}(t));const{complete:l,tokens:c}=o.get(t);return l.test(a)?"complete":0===function(e,t,n){let i=0,r=0;for(const s of e){for(;r<t.length&&void 0!==t[r].fixed&&t[r].fixed!==s;)r+=1;if(r>=t.length)break;const e=t[r];void 0!==e.fixed||s===n?r+=1:e.test(s)&&(i+=1,r+=1)}return i}(a,c,n)?"empty":"incomplete"}},fc654eb7fab0(e,t,n){n.d(t,{U:()=>r});const i=Object.freeze([{type:"string",label:{ru:"Строка",en:"String"},variants:[{id:"phone",label:{ru:"Телефон",en:"Phone"}},{id:"password",label:{ru:"Пароль",en:"Password"},writeOnly:!0}],params:["placeholder","mask","nullable","required","readonly"]},{type:"text",label:{ru:"Текст",en:"Text"},variants:[],params:["placeholder","required","readonly"]},{type:"html",label:{ru:"Форматированный текст",en:"Formatted text"},variants:[],params:["placeholder","required","readonly"]},{type:"integer",label:{ru:"Целое число",en:"Integer"},variants:[{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","required","readonly"]},{type:"number",label:{ru:"Число",en:"Number"},variants:[{id:"scale",label:{ru:"Шкала 0–100",en:"Scale 0–100"}},{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","precision","required","readonly"]},{type:"date",label:{ru:"Дата",en:"Date"},variants:[],params:["required","readonly"]},{type:"datetime",label:{ru:"Дата и время",en:"Date and time"},variants:[],params:["min","max","step","required","readonly"]},{type:"time",label:{ru:"Время",en:"Time"},variants:[],params:["min","max","step","required","readonly"]},{type:"boolean",label:{ru:"Да или нет",en:"Yes or no"},variants:[],params:["trueText","falseText","required","readonly"]},{type:"choice",label:{ru:"Одно из списка",en:"One of a list"},variants:[{id:"buttons",label:{ru:"Кнопками",en:"As buttons"}}],params:["options","badgeAppearance","size","required","readonly"]},{type:"choices",label:{ru:"Несколько из списка",en:"Several of a list"},variants:[{id:"badges",label:{ru:"Значками",en:"As badges"}},{id:"checklist",label:{ru:"Флажками",en:"As a checklist"}},{id:"select",label:{ru:"Выпадающим списком",en:"As a dropdown"}}],params:["options","badgeAppearance","required","readonly"]},{type:"user",label:{ru:"Пользователь",en:"User"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"record",label:{ru:"Запись",en:"Record"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"relation",label:{ru:"Связь",en:"Relation"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"lookup",label:{ru:"Из справочника",en:"From a reference list"},variants:[],params:["options","multiple","placeholder","searchPlaceholder","required","readonly"]},{type:"file",label:{ru:"Файл",en:"File"},variants:[{id:"image",label:{ru:"Изображение",en:"Image"}},{id:"image-card",label:{ru:"Изображение карточкой",en:"Image card"}},{id:"image-list",label:{ru:"Изображения списком",en:"Image list"}}],params:["accept","multiple","formats","uploadText","uploadSupportingText","uploadHint","required","readonly"]},{type:"color",label:{ru:"Цвет",en:"Colour"},variants:[],params:["swatches","required","readonly"]},{type:"include",label:{ru:"Код",en:"Code"},variants:[],params:["language","required","readonly"]}]);function r(e,t){return{view:Boolean(t.view?.[e]),edit:Boolean(t.edit?.[e]),cell:t.cell?.[e]?"own":"text",filter:t.filter?.[e]?"own":"text"}}n.d(t,["u",0,i])},"5961360f41f4"(e,t,n){n.d(t,{f:()=>c});const i=Object.freeze(["main","tonal","outline"]),r=Object.freeze(["neutral","primary","secondary","tertiary","info","success","warning","error","on-surface"]),s=Object.freeze({danger:"error"}),o=Object.freeze(["1/3","1/2","1"]);function a(e){const t=String(e??"").trim().toLowerCase(),n=s[t]??t;return r.includes(n)?n:""}Object.freeze(r.flatMap(e=>i.filter(t=>!("on-surface"===e&&"tonal"===t)).flatMap(t=>o.map(n=>Object.freeze({type:t,scheme:e,size:n})))));const l=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function c(e={}){const t=e?.scheme??e?.color,n="string"==typeof t?t.trim():"",i=a(n);return i?{scheme:i,rootStyle:""}:l.test(n)?{scheme:"neutral",rootStyle:`--sf-badge--background-color: color-mix(in srgb, ${n} 24%, transparent); --sf-badge--color: var(--sf-on-surface)`}:{scheme:"neutral",rootStyle:""}}},"7623a90f1816"(e,t,n){n.a(e,async(e,t)=>{try{var i=n("deb1a4d61565"),r=n("5b7d7695b41b"),s=n("17828be41e75"),o=n("3ea81f4c3c20"),a=n("4284cc8c32e1"),l=n("99fb492b7fba"),c=n("d614908e644f"),u=n("1b42c5117087"),d=n("43090d1c8307"),p=n("18003344cff0"),h=n("40b137e60526"),f=n("844bdc4d24eb"),g=n("2f31b00ad99a"),m=e([i,r,d,p,h,g]);[i,r,d,p,h,g]=m.then?(await m)():m;var v=n.n(i);const y=["1.0.0","1.1.0","1.2.0","1.3.0","1.4.0","1.5.0","1.6.0","1.7.0","1.8.0","1.9.0","1.10.0","1.11.0","1.12.0","1.13.0","1.14.0","1.15.0","1.16.0","1.17.0"],b=["view","auto","edit","create"],w=20,x=["record","relation","user","lookup"],$=e=>Number.isInteger(e?.field_count)&&e.field_count>0&&(!Array.isArray(e.fields)||0===e.fields.length),k=(e,t)=>{const n=e=>String(e??"").split(".").map(e=>Number.parseInt(e,10)||0),[i,r]=[n(e),n(t)];for(let e=0;e<3;e+=1)if((i[e]??0)!==(r[e]??0))return(i[e]??0)>(r[e]??0);return!0},S="(min-width: 48rem)",T="14rem",_=5e3,A=[];function F(){return A[A.length-1]??null}function C(){A.forEach((e,t)=>{e.setAttribute("data-stack-depth",String(t)),e.toggleAttribute("data-stack-top",e===F()),e.requestComponentUpdate("stack")})}const z=e=>null===e||["string","number","boolean","undefined"].includes(typeof e)||"object"==typeof e&&(Array.isArray(e)||e.constructor===Object),E=e=>null==e?e:"object"==typeof e&&z(e)?Array.isArray(e)?e.map(e=>E(e)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,E(t)])):e,q=(e={})=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase()),t])),L={en:q(l.runtime),ru:q(c.runtime)},O=u.x,P=(0,r.elementFromManifest)(o,{base:v(),lang:{en:l,ru:c},source:"ru",aliases:a});class V extends P{static get props(){return{templateName:{attribute:"template",default:"default"},recordId:{attribute:"record-id",default:""},collection:{default:""},showRare:{attribute:"show-rare",type:Boolean,default:!1},size:{default:"1"},mode:{default:"auto"},emptyText:{attribute:"empty-text",default:"not filled in"},emptyRecordText:{attribute:"empty-record-text",default:"This record has nothing to show"},editText:{attribute:"edit-text",default:"edit"},saveText:{attribute:"save-text",default:"Save"},cancelText:{attribute:"cancel-text",default:"Cancel"},deleteText:{attribute:"delete-text",default:"Delete"},changedText:{attribute:"changed-text",default:"Fields changed"},errorsText:{attribute:"errors-text",default:"Errors"},conflictText:{attribute:"conflict-text",default:"The record changed; read it again"},sectionsLabel:{attribute:"sections-label",default:"Sections"},sectionsAs:{attribute:"sections-as",default:"list",values:["list","tabs"]},panel:{type:Boolean,default:!1},panelSize:{attribute:"panel-size",default:"1",values:["1/2","1","2","full"]},panelLabel:{attribute:"panel-label",default:""},panelWidth:{attribute:"panel-width",default:""},closeLabel:{attribute:"close-label",default:"Close"},copyLinkLabel:{attribute:"copy-link-label",default:"Copy link"},linkCopiedLabel:{attribute:"link-copied-label",default:"Link copied"},openFullLabel:{attribute:"open-full-label",default:"Open as a page"},configureText:{attribute:"configure-text",default:"Arrange the view"},doneConfiguringText:{attribute:"done-configuring-text",default:"Done"},resetViewText:{attribute:"reset-view-text",default:"Reset"},resetViewAskText:{attribute:"reset-view-ask-text",default:"Reset the whole view?"},cancelConfiguringText:{attribute:"cancel-configuring-text",default:"Cancel"},personalLayerText:{attribute:"personal-layer-text",default:"Personal"},viewProfileLabel:{attribute:"view-profile-label",default:"View"},addViewText:{attribute:"add-view-text",default:"Add a view"},newViewText:{attribute:"new-view-text",default:"New view"},deleteViewText:{attribute:"delete-view-text",default:"Remove the view"},lastSharedViewText:{attribute:"last-shared-view-text",default:"The only view everyone has"},sharedLayerText:{attribute:"shared-layer-text",default:"Everyone's"},widthText:{attribute:"width-text",default:"Full width"},fieldLabelText:{attribute:"field-label-text",default:"Name"},sectionIconText:{attribute:"section-icon-text",default:"Section glyph"},sectionIcons:{attribute:"section-icons",default:""},variantText:{attribute:"variant-text",default:"Template"},hintText:{attribute:"hint-text",default:"Hint"},hiddenText:{attribute:"hidden-text",default:"Hide"},configureHintText:{attribute:"configure-hint-text",default:"Drag fields between groups and onto a section on the left. Applied at once."},configureHintNarrowText:{attribute:"configure-hint-narrow-text",default:"Drag fields between groups. Applied at once."},fieldSettingsText:{attribute:"field-settings-text",default:"Field settings"},shownText:{attribute:"shown-text",default:"Shown"},showRareText:{attribute:"show-rare-text",default:"Show rare fields"},hideRareText:{attribute:"hide-rare-text",default:"Hide rare fields"},rareText:{attribute:"rare-text",default:"rare"},unplacedTitle:{attribute:"unplaced-title",default:"Not placed"},moveUpText:{attribute:"move-up-text",default:"Move up"},moveDownText:{attribute:"move-down-text",default:"Move down"},addFieldText:{attribute:"add-field-text",default:"Add a field"},inThisGroupText:{attribute:"in-this-group-text",default:"In this area"},renameText:{attribute:"rename-text",default:"Rename"},saveNameText:{attribute:"save-name-text",default:"Save the name"},cancelNameText:{attribute:"cancel-name-text",default:"Leave the name"},removeFieldText:{attribute:"remove-field-text",default:"Remove from this area"},removeGroupText:{attribute:"remove-group-text",default:"Remove this area"},removeSectionText:{attribute:"remove-section-text",default:"Remove this section"},addGroupText:{attribute:"add-group-text",default:"Add an area"},addSectionText:{attribute:"add-section-text",default:"Add a section"},newGroupTitle:{attribute:"new-group-title",default:"New area"},newSectionTitle:{attribute:"new-section-title",default:"New section"},noMatchText:{attribute:"no-match-text",default:"Nothing matches"},unplacedHintText:{attribute:"unplaced-hint-text",default:"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out."},viewConflictText:{attribute:"view-conflict-text",default:"The view changed and was read again"},viewDeniedText:{attribute:"view-denied-text",default:"You may not change this layer"},backLabel:{attribute:"back-label",default:"Back"},collectionLabel:{attribute:"collection-label",default:""},collectionIcon:{attribute:"collection-icon",default:""},favourite:{type:Boolean,default:!1},favouriteLabel:{attribute:"favourite-label",default:"Favourite"},menuLabel:{attribute:"menu-label",default:"More"},inheritedText:{attribute:"inherited-text",default:"by default"}}}constructor(){super(),this.hostPort=null,this.record=null,this.sections=[],this.selectedSection=null,this.renaming=null,this.namingView=!1,this.arrangementEntered=null,this.resetAsked=!1,this.epoch=0,this.groupReads=new Map,this.groupsReading=new Set,this.groupsRefused=new Map,this.groupEpoch=0,this.message="",this.editing=null,this.changed=new Map,this.errors=new Map,this.inputErrors=new Map,this.controlErrors=new Set,this.conflict=null,this.confirmation=null,this.optionPages=new Map,this.optionSearches=new Map,this.optionEpochs=new Map,this.uploads=new Map,this.view=null,this.configuring=!1,this._openedForDrag=!1,this.viewTarget="personal",this.layerDraft=null,this.entryErrors=new Map,this.viewEpoch=0,this.wide=!0,this.wideMedia=null,this.phoneSection=null}get recordId(){return this.getAttribute("record-id")||""}get collection(){return this.getAttribute("collection")||""}get showRare(){return this.getBooleanAttr("show-rare",!1)}get emptyRecordText(){return this.getAttribute("empty-record-text")||(0,d.pageText)(L,"emptyRecordText",this)}get isEmptyRecord(){if(!this.record)return!1;const e=this.sections??[];return!e.length||!e.some(e=>(e.groups??[]).some(e=>"related"===e.kind||(e.fields??[]).length>0))}get emptyText(){return this.getAttribute("empty-text")||(0,d.pageText)(L,"emptyText",this)}get editText(){return this.getAttribute("edit-text")||(0,d.pageText)(L,"editText",this)}get saveText(){return this.getAttribute("save-text")||(0,d.pageText)(L,"saveText",this)}get cancelText(){return this.getAttribute("cancel-text")||(0,d.pageText)(L,"cancelText",this)}get deleteText(){return this.getAttribute("delete-text")||(0,d.pageText)(L,"deleteText",this)}get unplaced(){const e=this.record?.unplaced;return Array.isArray(e)?e:[]}moveFieldToUnplaced(e,t){if(!this.configuring||!this.layerDraft)return!1;let n=null,i=null;for(const t of this.sections){for(const r of t.groups??[]){const t=(r.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){i=r,[n]=r.fields.splice(t,1);break}}if(n)break}if(!n)return!1;const r=this.record.unplaced??(this.record.unplaced=[]),s=Math.max(0,Math.min(Number.isInteger(t)?t:r.length,r.length));return r.splice(s,0,n),this._writeOrder(this.layerDraft.fields,r,{group:null}),i&&this._writeOrder(this.layerDraft.fields,i.fields??[],{group:String(i.key)}),this.requestComponentUpdate("view-move"),this.saveView()}get recordActions(){const e=this.record?.actions;return Array.isArray(e)?e.map(e=>String(e)):[]}async deleteRecord(){if("view"===this.mode||"create"===this.mode||!this.recordActions.includes("record.delete"))return!1;const e=await this._raise("record.delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null});return this.sfEmit("delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null,answer:e?.answer??null}),!!e&&("applied"===e.answer?(this.closePanel("deleted"),!0):"cancelled"===e.reason?(this._setState("ready"),!1):(this.message=e.message||e.reason||this.viewDeniedText,this._setState("ready"),this.requestComponentUpdate("delete-refused"),!1))}get changedText(){return this.getAttribute("changed-text")||(0,d.pageText)(L,"changedText",this)}get errorsText(){return this.getAttribute("errors-text")||(0,d.pageText)(L,"errorsText",this)}get conflictText(){return this.getAttribute("conflict-text")||(0,d.pageText)(L,"conflictText",this)}get sectionsAs(){return this.getEnumAttr("sections-as",["list","tabs"],"list")}get sectionsLabel(){return this.getAttribute("sections-label")||(0,d.pageText)(L,"sectionsLabel",this)}get panel(){return this.getBooleanAttr("panel",!1)&&!this.full}get full(){return this.getBooleanAttr("full",!1)}set full(e){this.toggleAttribute("full",Boolean(e))}get panelOpen(){return this.panel&&!this.hidden&&"false"!==this.getAttribute("open")}syncPanelOpen(){const e=A.indexOf(this);this.panelOpen&&this.isConnected&&e<0?(A.push(this),C()):!this.panelOpen&&e>=0&&(A.splice(e,1),C()),this.requestComponentUpdate("panel-open")}get revision(){return void 0===this.record?.revision||null===this.record?.revision?"":String(this.record.revision)}get section(){return this.selectedSection??""}get panelSize(){return this.getAttribute("panel-size")||"1"}get panelLabel(){return this.getAttribute("panel-label")||""}get panelWidth(){return this.getAttribute("panel-width")||""}get size(){return"1/2"===this.getAttribute("size")?"1/2":"1"}get mode(){const e=this.getAttribute("mode");return b.includes(e)?e:"auto"}get mayEdit(){return"view"!==this.mode&&("create"===this.mode||(!k(this.hostPort?.version,"1.12.0")||this.recordActions.includes("record.edit")))}get openAll(){return"create"===this.mode||"edit"===this.mode&&this.mayEdit}get drawerWidth(){const e=this.panelWidth;if(!e)return null;if(!this.wide)return e;return`min(${"list"===this.sectionsAs&&((this.sections??[]).length>=2||this.configuring)?`calc(${e} + ${T} + var(--sf-space-4))`:e}, calc(100vw - ${this.edgeRoom}))`}get edgeControlWidth(){const e="1/2"===this.size?"1\\/2":"1";return`calc(var(--sf-text-height-${e}) + 2 * var(--sf-ui-${e}--space-y-tightness-default))`}get edgeRoom(){return`calc(${this.edgeControlWidth} + 2 * var(--sf-space-1\\/2))`}get edgeControlCount(){return 1+(this.address?1:0)+(this.canOpenFullPage?1:0)}get closeLabel(){return this.getAttribute("close-label")||(0,d.pageText)(L,"closeLabel",this)}get linkCopiedLabel(){return this.getAttribute("link-copied-label")||(0,d.pageText)(L,"linkCopiedLabel",this)}get copyLinkLabel(){return this.getAttribute("copy-link-label")||(0,d.pageText)(L,"copyLinkLabel",this)}get configureText(){return this.getAttribute("configure-text")||(0,d.pageText)(L,"configureText",this)}get resetViewAskText(){return this.getAttribute("reset-view-ask-text")||(0,d.pageText)(L,"resetViewAskText",this)}get cancelConfiguringText(){return this.getAttribute("cancel-configuring-text")||(0,d.pageText)(L,"cancelConfiguringText",this)}get doneConfiguringText(){return this.getAttribute("done-configuring-text")||(0,d.pageText)(L,"doneConfiguringText",this)}get resetViewText(){return this.getAttribute("reset-view-text")||(0,d.pageText)(L,"resetViewText",this)}get addViewText(){return this.getAttribute("add-view-text")||(0,d.pageText)(L,"addViewText",this)}get newViewText(){return this.getAttribute("new-view-text")||(0,d.pageText)(L,"newViewText",this)}get deleteViewText(){return this.getAttribute("delete-view-text")||(0,d.pageText)(L,"deleteViewText",this)}get lastSharedViewText(){return this.getAttribute("last-shared-view-text")||(0,d.pageText)(L,"lastSharedViewText",this)}get viewProfileLabel(){return this.getAttribute("view-profile-label")||(0,d.pageText)(L,"viewProfileLabel",this)}get personalLayerText(){return this.getAttribute("personal-layer-text")||(0,d.pageText)(L,"personalLayerText",this)}get sharedLayerText(){return this.getAttribute("shared-layer-text")||(0,d.pageText)(L,"sharedLayerText",this)}get widthText(){return this.getAttribute("width-text")||(0,d.pageText)(L,"widthText",this)}get variantText(){return this.getAttribute("variant-text")||(0,d.pageText)(L,"variantText",this)}get hintText(){return this.getAttribute("hint-text")||(0,d.pageText)(L,"hintText",this)}get hiddenText(){return this.getAttribute("hidden-text")||(0,d.pageText)(L,"hiddenText",this)}get configureHintText(){return this.getAttribute("configure-hint-text")||(0,d.pageText)(L,"configureHintText",this)}get configureHintNarrowText(){return this.getAttribute("configure-hint-narrow-text")||(0,d.pageText)(L,"configureHintNarrowText",this)}get fieldSettingsText(){return this.getAttribute("field-settings-text")||(0,d.pageText)(L,"fieldSettingsText",this)}get shownText(){return this.getAttribute("shown-text")||(0,d.pageText)(L,"shownText",this)}get showRareText(){return this.getAttribute("show-rare-text")||(0,d.pageText)(L,"showRareText",this)}get hideRareText(){return this.getAttribute("hide-rare-text")||(0,d.pageText)(L,"hideRareText",this)}get rareText(){return this.getAttribute("rare-text")||(0,d.pageText)(L,"rareText",this)}get unplacedTitle(){return this.getAttribute("unplaced-title")||(0,d.pageText)(L,"unplacedTitle",this)}get moveUpText(){return this.getAttribute("move-up-text")||(0,d.pageText)(L,"moveUpText",this)}get moveDownText(){return this.getAttribute("move-down-text")||(0,d.pageText)(L,"moveDownText",this)}get addFieldText(){return this.getAttribute("add-field-text")||(0,d.pageText)(L,"addFieldText",this)}get renameText(){return this.getAttribute("rename-text")||(0,d.pageText)(L,"renameText",this)}get saveNameText(){return this.getAttribute("save-name-text")||(0,d.pageText)(L,"saveNameText",this)}get cancelNameText(){return this.getAttribute("cancel-name-text")||(0,d.pageText)(L,"cancelNameText",this)}get removeFieldText(){return this.getAttribute("remove-field-text")||(0,d.pageText)(L,"removeFieldText",this)}get removeGroupText(){return this.getAttribute("remove-group-text")||(0,d.pageText)(L,"removeGroupText",this)}get removeSectionText(){return this.getAttribute("remove-section-text")||(0,d.pageText)(L,"removeSectionText",this)}get addGroupText(){return this.getAttribute("add-group-text")||(0,d.pageText)(L,"addGroupText",this)}get addSectionText(){return this.getAttribute("add-section-text")||(0,d.pageText)(L,"addSectionText",this)}get newGroupTitle(){return this.getAttribute("new-group-title")||(0,d.pageText)(L,"newGroupTitle",this)}get newSectionTitle(){return this.getAttribute("new-section-title")||(0,d.pageText)(L,"newSectionTitle",this)}get sectionIconText(){return this.getAttribute("section-icon-text")||(0,d.pageText)(L,"sectionIconText",this)}get fieldLabelText(){return this.getAttribute("field-label-text")||(0,d.pageText)(L,"fieldLabelText",this)}get inThisGroupText(){return this.getAttribute("in-this-group-text")||(0,d.pageText)(L,"inThisGroupText",this)}get noMatchText(){return this.getAttribute("no-match-text")||(0,d.pageText)(L,"noMatchText",this)}get currentGroups(){const e=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return e?.groups??[]}groupAt(e){return this.currentGroups.findIndex(t=>String(t.key)===String(e))}get groupCount(){return this.currentGroups.length}moveGroupBy(e,t){const n=this.groupAt(e);if(n<0)return!1;const i=n+t;if(i<0||i>=this.groupCount)return!1;const r=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return!!r&&this.moveGroup(e,String(r.key),i)}fieldChoices(e){const t=String(e),n=this._addSession?.group===t?this._addSession:this._buildAddSession(t),i=new Set;for(const e of this._locateGroup(t)?.group?.fields??[])i.add(String(e.key));const r=this.addSearch.trim().toLowerCase(),s=[];for(const e of n.order)(!r||e.label.toLowerCase().includes(r)||e.key.toLowerCase().includes(r))&&s.push({...e,selected:i.has(e.key)});return s}_buildAddSession(e){const t=String(e),n=[],i=new Set,r=(e,t)=>{const r=String(e.key);i.has(r)||(i.add(r),n.push({key:r,label:String(e.label??e.key),group:t}))};for(const e of this._locateGroup(t)?.group?.fields??[])r(e,this.inThisGroupText);for(const e of this.unplaced??[])r(e,this.unplacedTitle);for(const e of this.sections??[])for(const n of e.groups??[]){if(String(n.key)===t||"related"===n.kind)continue;const e=String(n.label??n.key);for(const t of n.fields??[])r(t,e)}return{group:t,order:n}}startAddSession(e){return this._addSearch="",this._addSession=this._buildAddSession(e),this.requestComponentUpdate("add-session"),this._addSession}endAddSession(){this._addSession=null,this._addSearch="",this.requestComponentUpdate("add-session")}get addSearch(){return this._addSearch??""}setAddSearch(e){return this._addSearch=String(e??""),this.requestComponentUpdate("add-search"),this._addSearch}toggleFieldInGroup(e,t,n){return n?this.moveField(e,t,Number.MAX_SAFE_INTEGER):this.moveFieldToUnplaced(e)}get unplacedHintText(){return this.getAttribute("unplaced-hint-text")||(0,d.pageText)(L,"unplacedHintText",this)}get viewConflictText(){return this.getAttribute("view-conflict-text")||(0,d.pageText)(L,"viewConflictText",this)}get collectionLabel(){return this.getAttribute("collection-label")||""}get collectionIcon(){return this.getAttribute("collection-icon")||""}get favourite(){return this.hasAttribute("favourite")}get favouriteLabel(){return this.getAttribute("favourite-label")||(0,d.pageText)(L,"favouriteLabel",this)}get menuLabel(){return this.getAttribute("menu-label")||(0,d.pageText)(L,"menuLabel",this)}get inheritedText(){return this.getAttribute("inherited-text")||(0,d.pageText)(L,"inheritedText",this)}toggleFavourite(){const e=!this.favourite;return this.toggleAttribute("favourite",e),this.requestComponentUpdate("favourite"),this.dispatchEvent(new CustomEvent("sf-view-properties-favourite",{bubbles:!0,composed:!0,detail:{record_id:this.recordId||null,collection:this.collection||null,favourite:e}})),!0}get panelMenuItems(){const e=[];return this.canConfigureView&&!this.configuring&&e.push({id:"configure",name:this.configureText,icon:"tune"}),this.hasRare&&e.push({id:"show-rare",name:this.showRare?this.hideRareText:this.showRareText,icon:this.showRare?"unfold_less":"unfold_more"}),e}async openStandardMenu(e,{label:t,entries:n,select:i,align:r="end"}){if(!(e instanceof Element))return null;await(globalThis.SF?.Loader?.ensure?.(["sf-menu-context"]));let s=this._standardMenu;return s?.isConnected||(s=document.createElement("sf-menu-context"),s.setAttribute("popup",""),s.dataset.sfPropertyViewMenu="",s.addEventListener("sf-menu-context-select",e=>this._standardMenuSelect?.(e.detail?.id)),(this.closest("dialog[open]")||document.body).append(s),this._standardMenu=s),s.isOpen&&this._standardMenuAnchor===e?(s.close(),null):(s.setAttribute("aria-label",t??""),s.entries=n,this._standardMenuSelect=i,this._standardMenuAnchor=e,s.openFor(e,{align:r}))}viewProfileEntries(){const e=this.viewProfile;return this.viewProfiles.map(t=>({id:`view-profile:${t.id}`,text:t.label,kind:"radio",checked:t.id===e,icon:t.shared?"group":"person",caption:t.shared?this.sharedLayerText:this.personalLayerText}))}openPanelMenu(e){const t=[],n=this.viewProfiles;if(n.length>1&&!this.configuring){const e=n.find(e=>e.id===this.viewProfile);t.push({id:"view-profile",text:this.viewProfileLabel,icon:"view_sidebar",value:e?.label??"",submenu:this.viewProfileEntries()})}const i=this.panelMenuItems;t.length&&i.length&&t.push({type:"separator"}),t.push(...i.map(e=>({id:e.id,text:e.name,icon:e.icon})));const r=this.hostMenuEntries();return t.length&&r.length&&t.push({type:"separator"}),t.push(...r),t.length?this.openStandardMenu(e,{label:this.menuLabel,entries:t,select:e=>this._chooseStandardEntry(e)}):null}openViewProfileMenu(e){return this.openStandardMenu(e,{label:this.viewProfileLabel,entries:this.viewProfileEntries(),align:"start",select:e=>this._chooseStandardEntry(e)})}hostMenuElements(){const e=this.querySelector("[data-host-menu]")??this.panelContent?.()?.querySelector?.("[data-host-menu]");return e?[...e.children]:[]}hostMenuEntries(){return this.hostMenuElements().map((e,t)=>{const n=e.matches("a[href], button")?e:e.querySelector("a[href], button")??e,i=(e.getAttribute("text")??e.getAttribute("aria-label")??n.textContent??"").trim(),r=n.matches?.("a[href]")?n.getAttribute("href"):null;return{id:`host:${t}`,text:i,icon:e.getAttribute("icon")??e.getAttribute("icon-start")??e.dataset.icon??void 0,href:r||void 0,danger:"error"===e.getAttribute("scheme")||"true"===e.dataset.danger,disabled:e.hasAttribute("disabled")||!0===n.disabled}}).filter(e=>e.text)}_chooseStandardEntry(e){const t=String(e??"");if(t.startsWith("host:")){const e=this.hostMenuElements()[Number(t.slice(5))],n=e?.matches("a[href], button")?e:e?.querySelector("a[href], button")??e;return n?.matches?.("a[href]")||n?.click?.(),!0}return t.startsWith("view-profile:")?this.selectViewProfile(t.slice(13)):this.chooseMenuItem(t)}chooseMenuItem(e){return"configure"===e?this.startConfiguringView():"reset"===e?this.resetView():"show-rare"===e&&this.toggleShowRare()}get backLabel(){return this.getAttribute("back-label")||(0,d.pageText)(L,"backLabel",this)}get viewDeniedText(){return this.getAttribute("view-denied-text")||(0,d.pageText)(L,"viewDeniedText",this)}get openFullLabel(){return this.getAttribute("open-full-label")||(0,d.pageText)(L,"openFullLabel",this)}get address(){return this.record?.address??null}get canOpenFullPage(){return Boolean(this.address)&&Boolean(this.hostPort?.capabilities?.includes?.("record-open"))}static get observedAttributes(){return[...super.observedAttributes??[],"record-id","hidden","open","full"]}attributeChangedCallback(e,t,n){super.attributeChangedCallback?.(e,t,n),t!==n&&this.isConnected&&("record-id"===e&&this.hostPort&&this.load("record-id-changed"),"hidden"!==e&&"open"!==e&&"full"!==e||this.syncPanelOpen())}onConnected(){super.onConnected?.(),this.hasAttribute("data-state")||this.record||(this.setAttribute("data-state","loading"),this.setAttribute("aria-busy","true")),this.panelOpen&&!A.includes(this)&&(A.push(this),C()),this._onKeyDown=e=>{"Escape"===e.key&&this.panel&&(document.documentElement.dataset.sfPopoverOpen||F()===this&&(e.stopPropagation(),this.closePanel("escape")))},document.addEventListener("keydown",this._onKeyDown,!0),this._onSortableIntent=e=>{if(!this.configuring)return;const t=e.detail??{},[n,i]=String(t.to??"").split(":");i&&("section"===n?this.moveSection(t.item,t.index):"field"===n?this.moveField(t.item,i,t.index):"group"===n?this.moveGroup(t.item,i,t.index):"unplaced"===n&&this.moveFieldToUnplaced(t.item,t.index))},this.addEventListener("sf-sortable-intent",this._onSortableIntent),this._onDocumentSortableIntent=e=>{if(!this.panel||!this.configuring)return;const t=e.target?.closest?.(".sf-property-view-panel");t&&t.getAttribute("data-record-id")===String(this.recordId)&&this._onSortableIntent(e)},document.addEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState=e=>{if(!this.configuring)return;const t=e.detail?.state,n=globalThis.document?.querySelector?.(`.sf-property-view-panel[data-record-id="${this.recordId}"]`),i=n?.querySelector?.('[data-action="toggle-unplaced"]');if(!i)return;const r="true"===i.getAttribute("aria-expanded");if("picked"===t)return this._openedForDrag=!r,void(r||i.click());"dropped"!==t&&"cancelled"!==t||(this._openedForDrag&&"true"===i.getAttribute("aria-expanded")&&i.click(),this._openedForDrag=!1)},document.addEventListener("sf-sortable-state",this._onSortableState),this.wideMedia="function"==typeof globalThis.matchMedia?globalThis.matchMedia(S):null,this.wide=!this.wideMedia||this.wideMedia.matches,this._onWideChange=e=>{this.wide=e.matches,this.wide&&(this.phoneSection=null),this.requestComponentUpdate("viewport")},this.wideMedia?.addEventListener?.("change",this._onWideChange),this.hostPort&&(this.recordId||"create"===this.mode)?this.load("connected"):this.hostPort||this._requestHostPort()}_requestHostPort(){return!this.hostPort&&!this._portRequested&&(this._portRequested=!0,this.dispatchEvent(new CustomEvent("sf-host-port-request",{bubbles:!0,composed:!0,detail:{component:this,context:{owner:"property-view",record:this.recordId||null,group:null}}})),!0)}onDisconnected(){this._standardMenu?.close?.({restoreFocus:!1}),this._standardMenu?.remove(),this._standardMenu=null,this._portRequested=!1;const e=A.indexOf(this);e>=0&&(A.splice(e,1),C()),this._onKeyDown&&document.removeEventListener("keydown",this._onKeyDown,!0),this._onKeyDown=null,this.configuring=!1,this._bindSectionDropTarget(),this._onSortableIntent&&this.removeEventListener("sf-sortable-intent",this._onSortableIntent),this._onSortableIntent=null,this._onDocumentSortableIntent&&document.removeEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState&&document.removeEventListener("sf-sortable-state",this._onSortableState),this._onDocumentSortableIntent=null,this._onWideChange&&this.wideMedia?.removeEventListener?.("change",this._onWideChange),this._onWideChange=null,this.wideMedia=null,super.onDisconnected?.()}panelContent(){const e=this.querySelector("sf-drawer")??this._panelDrawer??null,t=e?.querySelector?.(".sf-property-view-panel");if(t)return t;const n=this.getAttribute("record-id")||"";return[...document.querySelectorAll(".sf-property-view-panel")].find(e=>e.dataset.recordId===n)??null}setHostPort(e){if(!e||"function"!=typeof e.raise||!y.includes(e.version))throw new TypeError(`sf-view-properties requires a declared property-view host port: ${y.join(", ")}`);return this.hostPort=e,this.isConnected&&(this.recordId||"create"===this.mode)&&this.load("host-connected"),this}visible(e,{conditions:t=!0}={}){const n=t?this.fieldValues():null;return(Array.isArray(e)?e:[]).filter(e=>e&&!0!==e.hidden).filter(e=>this.showRare||!0!==e.rare).filter(e=>!n||!e.when||(0,f.tm)(e,n).visible)}fieldValues(){const e=new Map,t=t=>{if(!t||void 0===t.key||null===t.key)return;const n=String(t.key);e.set(n,this.changed.has(n)?this.changed.get(n):t.value)};for(const e of this.sections??[])for(const n of e?.groups??[])(n?.fields??[]).forEach(t);return this.unplaced.forEach(t),e}conditionedField(e,t=this.fieldValues()){if(!e?.when)return e;const n=(0,f.tm)(e,t);return{...e,required:n.required,readonly:!0===e.readonly||!n.enabled}}_hiddenByCondition(){const e=this.fieldValues(),t=new Set,n=n=>{n?.when&&!(0,f.tm)(n,e).visible&&t.add(String(n.key))};for(const e of this.sections??[])for(const t of e?.groups??[])(t?.fields??[]).forEach(n);return this.unplaced.forEach(n),t}_savedValues(){const e=this._hiddenByCondition();return Object.fromEntries([...this.changed].filter(([t])=>!e.has(t)))}get viewHost(){const e=this.hostPort??null;if(this._viewHost?.host===e)return this._viewHost.view;const t=Object.create(e&&"object"==typeof e?e:null);return Object.assign(t,{formatFieldValue:(t,n)=>{const i=e?.formatFieldValue?.(t,n);if("string"==typeof i)return i;const r=t?.propertyType??t?.property_type??t?.type??t?.dataType;return(0,g.x)(r,n,this)||void 0}}),this._viewHost={host:e,view:t},t}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,hostPort:this.hostPort,viewHost:this.viewHost,size:this.size,mode:this.mode,mayEdit:this.mayEdit,openAll:this.openAll,createText:(0,d.pageText)(L,"createText",this),emptyText:this.emptyText,emptyRecordText:this.emptyRecordText,isEmptyRecord:this.isEmptyRecord,loading:"loading"===this.getAttribute("data-state")&&!this.record,panel:this.panel,panelOpen:this.panelOpen,recordLabel:this.record?.label?String(this.record.label):"",loadFailure:this.record?null:this.loadFailure??null,editText:this.editText,saveText:this.saveText,cancelText:this.cancelText,deleteText:this.deleteText,recordActions:this.recordActions,changedText:this.changedText,errorsText:this.errorsText,sectionsLabel:this.sectionsLabel,sectionsAs:this.sectionsAs,sections:this.sections,selectedSection:this.selectedSection,editing:this.editing,changed:this.changed,errors:this.inputErrors.size?new Map([...this.errors,...this.inputErrors]):this.errors,inputsInvalid:this.inputErrors.size>0,controlErrors:this.controlErrors,canPickRecords:this.canPickRecords,canUploadFiles:this.canUploadFiles,hostSlot:e=>this.getSlotContent(e),hasHostSlot:e=>this.hasSlotContent(e),address:this.address,stackDepth:this.stackDepth,drawerWidth:this.drawerWidth,sectionsWidth:T,isTopPanel:this.isTopPanel,conflict:this.conflict,confirmation:this.confirmation,confirmSaveText:(0,d.pageText)(L,"confirmSaveText",this),keepEditingText:(0,d.pageText)(L,"keepEditingText",this),message:this.message,visible:e=>this.visible(e),conditionedField:e=>this.conditionedField(e),fieldDisabled:e=>this.fieldDisabled(e),canConfigureView:this.canConfigureView,configuring:this.configuring,unplaced:this.unplaced,viewTarget:this.viewTarget,editableLayers:this.editableLayers,viewProfiles:this.viewProfiles,viewProfile:this.viewProfile,canDeleteViewProfile:e=>this.canDeleteViewProfile(e),layerDenied:e=>this.layerDenied(e),canChangeVisibility:e=>this.canChangeVisibility(e),entryError:(e,t)=>this.entryError(e,t),configureText:this.configureText,doneConfiguringText:this.doneConfiguringText,resetViewText:this.resetViewText,resetViewAskText:this.resetViewAskText,cancelConfiguringText:this.cancelConfiguringText,resetAsked:this.resetAsked,personalLayerText:this.personalLayerText,viewProfileLabel:this.viewProfileLabel,addViewText:this.addViewText,newViewText:this.newViewText,deleteViewText:this.deleteViewText,lastSharedViewText:this.lastSharedViewText,sharedLayerText:this.sharedLayerText,widthText:this.widthText,fieldLabelText:this.fieldLabelText,sectionIcons:this.sectionIcons,sectionIconChoices:this.sectionIconChoices,sectionIconText:this.sectionIconText,variantText:this.variantText,hintText:this.hintText,hiddenText:this.hiddenText,configureHintText:this.wide?this.configureHintText:this.configureHintNarrowText,fieldSettingsText:this.fieldSettingsText,shownText:this.shownText,showRareText:this.showRareText,hideRareText:this.hideRareText,rareText:this.rareText,unplacedTitle:this.unplacedTitle,moveUpText:this.moveUpText,moveDownText:this.moveDownText,addFieldText:this.addFieldText,canOpenFullPage:this.canOpenFullPage,groupAt:e=>this.groupAt(e),groupCount:this.groupCount,fieldChoices:e=>this.fieldChoices(e),addSearch:this.addSearch,inThisGroupText:this.inThisGroupText,renameText:this.renameText,saveNameText:this.saveNameText,cancelNameText:this.cancelNameText,removeFieldText:this.removeFieldText,removeGroupText:this.removeGroupText,removeSectionText:this.removeSectionText,addGroupText:this.addGroupText,addSectionText:this.addSectionText,newGroupTitle:this.newGroupTitle,newSectionTitle:this.newSectionTitle,renaming:this.renaming,namingView:this.namingView,noMatchText:this.noMatchText,unplacedHintText:this.unplacedHintText,panelMenuItems:this.panelMenuItems,collectionLabel:this.collectionLabel,collectionIcon:this.collectionIcon,favourite:this.favourite,favouriteLabel:this.favouriteLabel,menuLabel:this.menuLabel,addressUrl:this.addressUrl??this.address,copyFeedbackMs:_,linkCopiedLabel:this.linkCopiedLabel,closeLabel:this.closeLabel,copyLinkLabel:this.copyLinkLabel,openFullLabel:this.openFullLabel,inheritedText:this.inheritedText,wide:this.wide,edgeControlWidth:this.edgeControlWidth,edgeControlCount:this.edgeControlCount,phoneSection:this.phoneSection,phoneSectionLabel:this.phoneSectionLabel,backLabel:this.backLabel})}template(){return(0,h.$)(this.templateContext())}sfAwaitingData(){return"skeleton"===this.getAttribute("data-sf-first-paint")&&!this.panel&&(!this.record&&!this.loadFailure&&"error"!==this.getAttribute("data-state"))}_setState(e,t=""){const n="loading"===e&&"loading"===this.getAttribute("data-state")&&!this.record;this.setAttribute("data-state",e),this.setAttribute("aria-busy","loading"===e?"true":"false"),this.message=t,n||this.requestComponentUpdate("state"),this.dispatchEvent(new CustomEvent("sf-view-properties-state",{bubbles:!0,composed:!0,detail:{state:e,message:t}}))}async _raise(e,t,{stale:n=()=>!1}={}){if(!this.hostPort)return this._setState("error",(0,d.pageText)(L,"statePortNotConnected",this)),{answer:"unavailable",reason:"port-not-connected"};try{const i=await this.hostPort.raise(e,E(t),{});if(!this.isConnected||n())return null;if(!i||!["applied","conflict","refused","unavailable"].includes(i.answer))throw new TypeError("Host answer is not a declared port answer");return"applied"===i.answer&&Array.isArray(i.effects)&&i.effects.length&&globalThis.SF?.Composition?.publishEffects?.(i.effects,{origin:this}),i}catch(e){return!this.isConnected||n()?null:(this._setState("error",(0,d.pageText)(L,"stateLoadFailed",this)),{answer:"unavailable",reason:"host-threw",message:String(e?.message||e)})}}get readsByGroup(){return Boolean(this.hostPort?.capabilities?.includes("group-load"))&&"create"!==this.mode}async load(e="requested"){this._setState("loading",(0,d.pageText)(L,"stateLoading",this)),this.loadFailure=null;const t=++this.epoch,n="create"===this.mode,i=this.readsByGroup;i&&(this.groupEpoch+=1,this.groupReads=new Map,this.groupsReading=new Set);const r=i?await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,group:null,reason:e},{stale:()=>t!==this.epoch}):await this._raise("record.load",{record_id:n?null:this.recordId||null,collection:this.collection||null,reason:e,...n?{mode:"create"}:{}},{stale:()=>t!==this.epoch});if(!r)return null;if("applied"!==r.answer&&!n&&!this.recordId)return r;if("applied"!==r.answer)return this.loadFailure={kind:"refused"===r.answer?"no-access":"error",text:r.message||""},this._setState("error",r.message||(0,d.pageText)(L,"stateUnavailable",this)),this.sfEmit("failed",{reason:String(r.reason??""),message:String(r.message??"")}),r;this.record=i?{...r.record??{},revision:r.revision??r.record?.revision??null}:r.record??null,this.sections=[],this._takeSections(this.record),this.view=r.record?.view??null;const s=this.editableLayers;s.includes(this.viewTarget)||(this.viewTarget=s[0]??"personal"),s.length||(this.configuring=!1),this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this.entryErrors=new Map;const o=this.sections.some(e=>String(e.key)===this.selectedSection),a=i&&void 0!==r.group&&null!==r.group?this.sections.find(e=>(e.groups??[]).some(e=>String(e.key)===String(r.group))):null;return o||(this.selectedSection=a?String(a.key):this.sections.length?String(this.sections[0].key):null),this._setState("ready"),i&&this._readShownGroups("started"),r}_takeSections(e){if(!Array.isArray(e?.sections))return;const t=E(e.sections);if(!this.readsByGroup)return void(this.sections=t);const n=void 0===e.revision||null===e.revision?"":String(e.revision),i=new Map(this.sections.flatMap(e=>(e.groups??[]).map(e=>[String(e.key),e])));for(const e of t){const t=Array.isArray(e.groups)?e.groups:[];t.forEach((e,r)=>{const s=String(e.key);if(!$(e))return void this.groupReads.set(s,n);const o=i.get(s);o&&this.groupReads.has(s)&&(t[r]={...e,fields:o.fields})})}this.sections=t}_shownGroups(){return(this.openAll||this.configuring?this.sections:this.sections.filter(e=>String(e.key)===this.selectedSection)).flatMap(e=>(e.groups??[]).map(t=>({section:String(e.key),group:String(t.key)})))}_readShownGroups(e="started",{force:t=!1}={}){if(!this.readsByGroup||!this.record)return[];const n=this.revision,i=[];for(const{section:r,group:s}of this._shownGroups())this.groupsReading.has(s)||this.groupsRefused.get(s)!==n&&(t||this.groupReads.get(s)!==n)&&i.push(this._readGroup(r,s,e));return i}async _readGroup(e,t,n){const i=this.groupEpoch;this.groupsReading.add(t),this.requestComponentUpdate("group-reading");const r=await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,section:e,group:t,reason:n},{stale:()=>i!==this.groupEpoch});if(i!==this.groupEpoch)return null;if(this.groupsReading.delete(t),!r)return null;if("refused"===r.answer&&"unknown-group"===r.reason){const e=this.revision;return this.groupsRefused.get(t)===e||(this.groupsRefused.set(t,e),await this.load("requested")),r}if("applied"!==r.answer)return this.requestComponentUpdate("group-reading"),r;const s=r.revision??r.record?.revision??this.record?.revision??null;return this.record={...this.record,...r.record??{},revision:s},this._takeSections(this.record),this.requestComponentUpdate("group-read"),r}isGroupReading(e){return this.groupsReading.has(String(e))}async _rereadAfterConflict(e){if(this.readsByGroup)return void 0!==e?.revision&&null!==e.revision&&this.record&&(this.record={...this.record,revision:e.revision}),Promise.all(this._readShownGroups("requested",{force:!0}));const t=this.epoch,n=await this._raise("record.load",{record_id:this.recordId||null,collection:this.collection||null,reason:"requested"},{stale:()=>t!==this.epoch});return n&&"applied"===n.answer&&n.record?(this.record=n.record,this._takeSections(n.record),this.requestComponentUpdate("conflict-reread"),n):n}get canUploadFiles(){return Boolean(this.hostPort?.capabilities?.includes("field-upload"))}getFieldUploads(e){return this.uploads.get(String(e.key??""))??[]}async startFieldUpload(e,t){const n=String(e.key??""),i=Array.isArray(t)?t:[];if(!i.length)return null;this.uploads.set(n,[...this.getFieldUploads(e),...i]),this.requestComponentUpdate("uploads");for(const t of i){const i=await this._raise("field.upload",{record_id:this.recordId||null,collection:this.collection||null,field:n,file:t.file??t},{stale:()=>!this.uploads.has(n)});if(!i)return null;const r=this.getFieldUploads(e);if("applied"===i.answer&&i.file){const s=this.changed.has(n)?this.changed.get(n):e.value,o=Array.isArray(s)?s:s?[s]:[];this.changed.set(n,[...o,i.file]),this.uploads.set(n,r.filter(e=>e!==t)),this.errors.delete(n)}else this.uploads.set(n,r.map(e=>e===t?{...e,state:"error",errorMessage:i.message||i.reason||""}:e)),"refused"===i.answer&&i.reason&&this.errors.set(n,String(i.message||i.reason));this.requestComponentUpdate("uploads")}return this}retryFieldUpload(e,t){const n=String(e.key??""),i=this.getFieldUploads(e),r=i[Number(t)];return r?(this.uploads.set(n,i.filter(e=>e!==r)),this.startFieldUpload(e,[r])):null}async openReference(e,t){if(!t||"object"!=typeof t)return null;const n=await this._raise("record.open",{record_id:this.recordId||null,collection:this.collection||null,field:String(e.key??""),value:t},{stale:()=>!this.isConnected});return this.sfEmit("open",{field:String(e.key??""),value:t,answer:n?.answer??null}),n}get stackDepth(){const e=A.indexOf(this);return e<0?0:e}get isTopPanel(){return F()===this}closePanel(e="close"){this._commitFocusedEntry();const t=this.unsavedFields;return this.sfEmit("close",{reason:e,record_id:this.recordId||null,unsaved_fields:t},{cancelable:!0})?{outcome:"applied"}:{outcome:"refused",reason:"prevented"}}get unsavedFields(){return new Set([...this.changed.keys(),...this.inputErrors.keys()]).size}_commitFocusedEntry(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;if(!e||"function"!=typeof e.blur)return;const t=this.panel?this.panelContent():null;(this.contains(e)||t?.contains(e))&&e.blur()}get addressUrl(){const e=this.address;if(!e)return null;try{return new URL(String(e),globalThis.location?.href).href}catch{return String(e)}}copyControl(){return[...document.querySelectorAll('sf-button-copy[data-action="copy-link"]')].find(e=>e.propertyView===this)??null}get addressCopied(){return"success"===this.copyControl()?.state?.phase}announceAddressCopy(e){const t=this.address;return this.dispatchEvent(new CustomEvent("sf-view-properties-address-copy",{bubbles:!0,composed:!0,detail:{address:t,url:this.addressUrl??t,copied:e,record_id:this.recordId||null}})),e}async copyAddress(){if(!this.address)return null;const e=this.copyControl();return e?.copy?Boolean(await e.copy()):null}openFullPage(){const e=this.address;return e?(this.sfEmit("open-full",{id:this.recordId||null,address:e,record_id:this.recordId||null}),this):null}openPhoneSection(e){const t=String(e);return!!this.sections.some(e=>String(e.key)===t)&&(this.phoneSection=t,this.selectSection(t),this.requestComponentUpdate("phone-section"),!0)}closePhoneSection(){return null!==this.phoneSection&&(this.phoneSection=null,this.requestComponentUpdate("phone-section"),!0)}get phoneSectionLabel(){const e=this.sections.find(e=>String(e.key)===this.phoneSection);return e?String(e.label??e.key):""}selectSection(e){return this.selectedSection=String(e),this.requestComponentUpdate("section"),this._readShownGroups("started"),this}get canPickRecords(){return Boolean(this.hostPort?.capabilities?.includes("field-options"))}getFieldOptionsPage(e){return this.optionPages.get(String(e.key??""))??null}getFieldOptionSearch(e){return this.optionSearches.get(String(e.key??""))??""}setFieldOptionSearch(e,t){return this.optionSearches.set(String(e.key??""),String(t??"")),this}async loadFieldOptions(e,{cursor:t=null,search:n="",quiet:i=!1}={}){const r=String(e.key??""),s=this.optionPages.get(r),o=t&&Array.isArray(s?.items)?s.items:[];this.optionPages.set(r,{items:o,status:"loading",quiet:i,nextCursor:s?.nextCursor??null}),this.requestComponentUpdate("options");const a=this.epoch,l=(this.optionEpochs.get(r)??0)+1;this.optionEpochs.set(r,l);const c=await this._raise("field.options",{record_id:this.recordId||null,collection:this.collection||null,field:r,cursor:t,search:String(n??""),...k(this.hostPort?.version,"1.14.0")?{...e.source?{source:String(e.source)}:{},limit:w}:{}},{stale:()=>a!==this.epoch||l!==this.optionEpochs.get(r)});if(!c)return null;if("applied"!==c.answer){const e="refused"===c.answer;return this.optionPages.set(r,{items:o,status:e?"unsupported":"error",quiet:!1,nextCursor:null}),this.requestComponentUpdate("options"),c}const u=c.options_page??{},d=Array.isArray(u.items)?u.items:[];return this.optionPages.set(r,{items:t?[...o,...d]:d,status:"ready",quiet:!1,nextCursor:u.next_cursor??null,total:u.total??null}),this.requestComponentUpdate("options"),c}changeField(e,t){const n=String(e.key??""),i=Object.hasOwn(e??{},"value")&&void 0!==t&&JSON.stringify(t)===JSON.stringify(e.value??null);return void 0===t||i?this.changed.delete(n):this.changed.set(n,t),this.errors.delete(n),this.confirmation=null,this.requestComponentUpdate("changed"),this}_clearInputs(){this.inputErrors.clear(),this.controlErrors.clear()}reportFieldError(e,t){const n=String(e?.key??"");if(!n)return this;const i=this.inputErrors.get(n);return t?(this.inputErrors.set(n,String(t)),this.controlErrors.add(n)):this.controlErrors.has(n)&&(this.inputErrors.delete(n),this.controlErrors.delete(n)),this.inputErrors.get(n)!==i&&this.requestComponentUpdate("errors"),this}fieldDisabled(e,t=this.fieldValues()){return Boolean(e?.when)&&!(0,f.tm)(e,t).enabled}_inputsInvalid(){return this.inputErrors.size?(this.requestComponentUpdate("errors"),{answer:"refused",reason:"input_invalid",errors:Object.fromEntries(this.inputErrors)}):null}_referenceFields(e,t){const n=this.sections.find(t=>String(t.key)===String(e)),i=this.visible(n?.groups).find(e=>String(e.key)===String(t));return this.visible(i?.fields,{conditions:!1}).filter(e=>x.includes(e.propertyType||e.type)).filter(e=>!("lookup"===(e.propertyType||e.type)&&Array.isArray(e.options)&&e.options.length>0))}editGroup(e,t){if(!this.mayEdit)return this;if(this.editing={section:String(e),group:String(t)},this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this.canPickRecords)for(const n of this._referenceFields(e,t))this.optionPages.has(String(n.key??""))||this.loadFieldOptions(n,{cursor:null,search:"",quiet:!0});return this}cancelEdit(){if(this.openAll)return this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode}})),this.panel?(this.closePanel("cancelled"),this):(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this);const e=this.editing;return this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),e&&this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode,scope:"group",section:e.section,group:e.group}})),this}announceSaved(e){const t=this.recordId||e?.record_id||e?.record?.record_id||null,n=e?.revision??e?.record?.revision??this.record?.revision??null;this.sfEmit("saved",{id:t,revision:null===n?"":String(n)})}async saveGroup({confirm:e=null}={}){if(this.openAll)return this.saveAll({confirm:e});if(this.editing&&this.inputErrors.size)return this._inputsInvalid();if(!this.editing||0===this.changed.size)return null;const t=this._savedValues();if(!Object.keys(t).length)return null;this.confirmation=null;const n=++this.epoch,i=await this._raise("group.save",{record_id:this.recordId||null,collection:this.collection||null,section:this.editing.section,group:this.editing.group,values:t,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>n!==this.epoch});return i?this._askedToConfirm(i)?i:"applied"===i.answer?(this.record=i.record?{...i.record,revision:i.revision??i.record.revision}:{...this.record,revision:i.revision??this.record?.revision??null},this._takeSections(this.record),this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this._setState("ready"),this.announceSaved(i),i):"conflict"===i.answer?(this.conflict=i.message||this.conflictText,this.requestComponentUpdate("conflict"),await this._rereadAfterConflict(i),i):"refused"===i.answer&&"unknown-group"===i.reason?(await this.load("requested"),i):"refused"===i.answer?(this.errors=new Map(Object.entries(i.errors??{}).map(([e,t])=>[e,String(t)])),this.requestComponentUpdate("errors"),i):(this._setState("error",i.message||(0,d.pageText)(L,"saveFailedText",this)),i):null}async saveAll({confirm:e=null}={}){if(this.inputErrors.size)return this._inputsInvalid();if("create"!==this.mode&&0===this.changed.size)return null;const t="create"===this.mode,n=this._savedValues();if(!t&&!Object.keys(n).length)return null;this.confirmation=null;const i=++this.epoch,r=t?await this._raise("record.create",{collection:this.collection||null,values:n},{stale:()=>i!==this.epoch}):await this._raise("record.save",{record_id:this.recordId||null,collection:this.collection||null,values:n,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>i!==this.epoch});if(!r)return null;if(!t&&this._askedToConfirm(r))return r;if("applied"===r.answer){if(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,t){const e=r.record_id??r.record?.record_id??null;return this.dispatchEvent(new CustomEvent("sf-view-properties-created",{bubbles:!0,composed:!0,detail:{record_id:e,collection:this.collection||null}})),null!==e&&(this.setAttribute("record-id",String(e)),this.setAttribute("mode","auto"),r.record?(this.record=r.record,this._takeSections(r.record),this.view=r.record.view??this.view,this._setState("ready")):await this.load("created")),r}return this.record=r.record??this.record,this._takeSections(r.record),this._setState("ready"),this.announceSaved(r),r}return"conflict"===r.answer?(this.conflict=r.message||this.conflictText,this.requestComponentUpdate("conflict"),r):"refused"===r.answer?(this.errors=new Map(Object.entries(r.errors??{}).map(([e,t])=>[e,String(t)])),!this.errors.size&&r.message&&(this.conflict=r.message),this.requestComponentUpdate("errors"),r):(this._setState("error",r.message||(0,d.pageText)(L,"saveFailedText",this)),r)}_askedToConfirm(e){const t=e?.confirm;return!("refused"!==e?.answer||"confirm_required"!==e.reason||!t||"string"!=typeof t.digest||!t.digest)&&(this.confirmation={text:String(t.summary||e.message||""),digest:t.digest},this.requestComponentUpdate("confirmation"),!0)}confirmSave(){const e=this.confirmation?.digest;return e?this.openAll?this.saveAll({confirm:e}):this.saveGroup({confirm:e}):Promise.resolve(null)}cancelConfirmation(){return this.confirmation=null,this.requestComponentUpdate("confirmation"),this}get canConfigureView(){return"view"!==this.mode&&(Boolean(this.hostPort?.capabilities?.includes?.("view-settings"))&&Boolean(this.view)&&this.editableLayers.length>0)}get viewProfiles(){const e=this.view?.profiles;return Array.isArray(e)?e.filter(e=>e&&"string"==typeof e.id&&e.id):[]}get viewProfile(){const e=this.view?.profile;return"string"==typeof e&&e?e:this.viewProfiles[0]?.id??null}canDeleteViewProfile(e){const t=this.viewProfiles,n=t.find(t=>t.id===String(e??""));return!!n&&(!n.shared||t.filter(e=>e.shared).length>1)}createViewProfile(e,{shared:t=!1}={}){const n=String(e??"").trim();return n?(this.namingView&&(this.namingView=!1,this.requestComponentUpdate("view-naming")),this._viewProfileIntent("view.create",{label:n,shared:Boolean(t),view:this.layerDraft??this._layerCopy(this.viewTarget)})):null}startNamingView(){return this.namingView=!0,this.requestComponentUpdate("view-naming"),!0}cancelNamingView(){this.namingView=!1,this.requestComponentUpdate("view-naming")}renameViewProfile(e,t){const n=String(t??"").trim(),i=String(e??"");return n&&i&&this.viewProfiles.some(e=>e.id===i)?this._viewProfileIntent("view.rename",{profile:i,label:n}):null}deleteViewProfile(e){const t=String(e??"");return this.canDeleteViewProfile(t)?this._viewProfileIntent("view.delete",{profile:t}):null}async _viewProfileIntent(e,t){const n=++this.epoch,i=await this._raise(e,{record_id:this.recordId||null,collection:this.collection||null,...t},{stale:()=>n!==this.epoch});return i?"applied"!==i.answer?(this._setState("error",i.message||this.viewDeniedText),i):(this.record=i.record??this.record,this._takeSections(i.record),this.view=i.record?.view??this.view,this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this._setState("ready"),this.requestComponentUpdate("profiles"),i):null}async selectViewProfile(e){const t=String(e??"");if(!t||t===this.viewProfile)return null;if(!this.viewProfiles.some(e=>e.id===t))return null;const n=++this.epoch,i=await this._raise("view.profile",{record_id:this.recordId||null,collection:this.collection||null,profile:t},{stale:()=>n!==this.epoch});return i?"applied"!==i.answer?(this._setState("error",i.message||this.viewDeniedText),i):(this.record=i.record??this.record,this._takeSections(i.record),this.view=i.record?.view??this.view,this.editing=null,this.changed.clear(),this._clearInputs(),this._setState("ready"),this.configuring&&this.setViewTarget(this._layerOfProfile()),this.requestComponentUpdate("profile"),i):null}get editableLayers(){const e=this.view?.editable;return Array.isArray(e)?e.filter(e=>"personal"===e||"shared"===e):[]}layerDenied(e){return this.editableLayers.includes(e)?null:this.view?.denied?.[e]||this.viewDeniedText}_emptyLayer(){return{schema_version:1,sections:{},groups:{},fields:{}}}_layerCopy(e){const t=this.view?.layers?.[e]?.view;return t?E(t):this._emptyLayer()}_layerRevision(e){const t=this.view?.layers?.[e];return t?t.revision??null:null}toggleShowRare(){return this.toggleAttribute("show-rare",!this.showRare),this.requestComponentUpdate("show-rare"),this.showRare}get hasRare(){const e=e=>(e??[]).some(e=>!0===e?.rare);return(this.sections??[]).some(t=>!0===t?.rare||e(t?.groups)||(t?.groups??[]).some(t=>e(t?.fields)))}_layerOfProfile(){const e=this.viewProfiles.find(e=>e.id===this.viewProfile),t=e?.shared?"shared":"personal";return this.editableLayers.includes(t)?t:this.viewTarget}startConfiguringView(){return!!this.canConfigureView&&(this.configuring=!0,this.viewProfiles.length&&(this.viewTarget=this._layerOfProfile()),this.arrangementEntered={kind:this.viewTarget,revision:this._layerRevision(this.viewTarget),view:this._layerCopy(this.viewTarget)},this.resetAsked=!1,this.layerDraft=this._layerCopy(this.viewTarget),this._bindSectionDropTarget(),this.entryErrors=new Map,this.cancelEdit(),this.requestComponentUpdate("configuring"),this._readShownGroups("started"),this._focusAfterRender(['.sf-property-view-configure-bar [data-action="view-profile"]',".sf-property-view-configure-bar"]),!0)}stopConfiguringView(){const e=this.configuring;this.configuring=!1,this._bindSectionDropTarget(),this.layerDraft=null,this.arrangementEntered=null,this.resetAsked=!1,this.entryErrors=new Map,this.requestComponentUpdate("configuring"),e&&this._focusAfterRender('[data-action="menu"]')}_focusAfterRender(e){const t=e=>(e?.matches?.(p.FOCUSABLE)?e:e?.querySelector?.(p.FOCUSABLE))??null;this.whenRendered(()=>requestAnimationFrame(async()=>{const n=this.panelContent?.()??this;let i=null;for(const r of[e].flat()){const e=[...n?.querySelectorAll?.(r)??[]].pop()??null;if(e&&(i=t(e),!i&&e.localName.includes("-")&&(await customElements.whenDefined(e.localName),await(e.whenRendered?.()),await new Promise(e=>requestAnimationFrame(e)),i=t(e)),i))break}if(!i||!i.isConnected)return;const r=document.activeElement;r&&r!==document.body&&n?.contains?.(r)||i.focus({preventScroll:!0})}),{next:!0})}async cancelConfiguringView(){if(!this.configuring)return!1;const e=this.arrangementEntered;if(!e||e.kind!==this.viewTarget)return this.stopConfiguringView(),!0;const t=(e,t)=>JSON.stringify(e)===JSON.stringify(t),n=this._layerCopy(e.kind);if(null!=e.revision&&this._layerRevision(e.kind)===e.revision||t(n,e.view))return t(this.layerDraft,e.view)||await this.load("view-cancel"),this.stopConfiguringView(),!0;this.layerDraft=E(e.view);const i=await this.saveView();return await this.load("view-cancel"),this.stopConfiguringView(),i}askReset(){return!!this.configuring&&(this.resetAsked=!0,this.requestComponentUpdate("reset-ask"),!0)}cancelReset(){return this.resetAsked=!1,this.requestComponentUpdate("reset-ask"),!0}setViewTarget(e){return!(!this.editableLayers.includes(e)||e===this.viewTarget)&&(this.viewTarget=e,this.layerDraft=this._layerCopy(e),this.entryErrors=new Map,this.requestComponentUpdate("view-target"),!0)}canChangeVisibility(e){const t=e?.hiddenBy??null;return!t||"package"!==t&&("shared"!==t||"shared"===this.viewTarget)}entryError(e,t){return this.entryErrors.get(`${e}:${t}`)??null}_groupsOf(e){const t=this.sections.find(t=>String(t.key)===String(e));return Array.isArray(t?.groups)?t.groups:[]}_fieldsOf(e){for(const t of this.sections)for(const n of t.groups??[])if(String(n.key)===String(e))return Array.isArray(n.fields)?n.fields:[];return[]}_locateGroup(e){for(const t of this.sections)for(const n of t.groups??[])if(String(n.key)===String(e))return{section:t,group:n};return null}_writeOrder(e,t,n={}){t.forEach((t,i)=>{const r=String(t.key);e[r]={...e[r]??{},...n,order:i+1}})}moveFieldToSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const n=(this.sections??[]).find(e=>String(e.key)===String(t));if(!n)return!1;const i=(n.groups??[]).find(e=>"related"!==e.kind);return!!i&&this.moveField(e,String(i.key),(i.fields??[]).length)}_bindSectionDropTarget(){if(!this.configuring)return this._releaseSectionTarget?.(),void(this._releaseSectionTarget=null);if(this._releaseSectionTarget)return;const e=globalThis.SF?.Sortable?.registerSortableDropTarget;if("function"!=typeof e)return;const t=(e,t)=>{const n=globalThis.document?.elementFromPoint?.(e,t),i=n?.closest?.("[data-section-tab], .sf-tree-item[data-value]"),r=this.panelContent();return i&&r&&r.contains(i)?i:null};this._releaseSectionTarget=e({resolve:(e,n,i)=>{if(i?.group&&!["field","group"].includes(i.group))return null;const r=t(e,n);if(!r)return null;const s=r.getAttribute("data-section-tab")??r.getAttribute("data-value");if(s===this.selectedSection)return null;return{descriptor:{section:s},rect:(r.matches("[data-section-tab]")?r:r.querySelector(":scope > .sf-tree-item-container")||r).getBoundingClientRect(),label:r.querySelector(":scope > .sf-tree-item-container > .sf-tree-item-name")?.textContent?.trim()||r.textContent?.trim()||s}},drop:(e,t)=>!!t?.section&&("group"===e?.group?this.moveGroup(e?.item,t.section,Number.MAX_SAFE_INTEGER):this.moveFieldToSection(e?.item,t.section))})}moveField(e,t,n){if(!this.configuring||!this.layerDraft)return!1;const i=this._locateGroup(t);if(!i)return!1;let r=null,s=null;for(const t of this.sections){for(const n of t.groups??[]){const t=(n.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){s=n,[r]=n.fields.splice(t,1);break}}if(r)break}let o=!1;if(!r){const t=this.record?.unplaced??[],n=t.findIndex(t=>String(t.key)===String(e));n>=0&&([r]=t.splice(n,1),o=!0)}if(!r)return!1;const a=i.group.fields??(i.group.fields=[]),l=Math.max(0,Math.min(Number.isInteger(n)?n:a.length,a.length));return a.splice(l,0,r),this._writeOrder(this.layerDraft.fields,a,{group:String(t)}),o&&this._writeOrder(this.layerDraft.fields,this.record?.unplaced??[],{group:null}),s&&s!==i.group&&this._writeOrder(this.layerDraft.fields,s.fields??[],{group:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}moveGroup(e,t,n){if(!this.configuring||!this.layerDraft)return!1;const i=this.sections.find(e=>String(e.key)===String(t));if(!i)return!1;let r=null,s=null;for(const t of this.sections){const n=(t.groups??[]).findIndex(t=>String(t.key)===String(e));if(n>=0){s=t,[r]=t.groups.splice(n,1);break}}if(!r)return!1;const o=i.groups??(i.groups=[]),a=Math.max(0,Math.min(Number.isInteger(n)?n:o.length,o.length));return o.splice(a,0,r),this._writeOrder(this.layerDraft.groups,o,{section:String(t)}),s&&s!==i&&this._writeOrder(this.layerDraft.groups,s.groups??[],{section:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}setFieldView(e,t={}){if(!this.configuring||!this.layerDraft)return!1;const n=["width","variant","hint","label"],i=Object.fromEntries(Object.entries(t).filter(([e])=>n.includes(e)));if(!Object.keys(i).length)return!1;const r=String(e);this.layerDraft.fields[r]={...this.layerDraft.fields[r]??{},...i};for(const e of this.sections)for(const t of e.groups??[])for(const e of t.fields??[])String(e.key)===r&&Object.assign(e,i);return this.requestComponentUpdate("view-field"),this.saveView()}get sectionIcons(){return this.getAttribute("section-icons")||""}get sectionIconChoices(){const e=this.sectionIcons;return e?e.split(/[\s,]+/u).filter(Boolean):O}setSectionIcon(e,t){if(!this.configuring||!this.layerDraft)return!1;const n=String(e),i=this.sections.find(e=>String(e.key)===n);if(!i)return!1;const r=String(t??"").trim()||null;return this.layerDraft.sections[n]={...this.layerDraft.sections[n]??{},icon:r},i.icon=r,this.requestComponentUpdate("view-section-icon"),this.saveView()}renameEntry(e,t,n){if(!this.configuring||!this.layerDraft)return!1;const i={section:"sections",group:"groups"}[e];if(!i)return!1;const r=String(n??"").trim();if(!r)return!1;const s=this._findEntry(e,t);if(!s)return!1;const o=String(t);return this.layerDraft[i][o]={...this.layerDraft[i][o]??{},label:r},s.label=r,this.renaming=null,this.requestComponentUpdate("view-rename"),this.saveView()}startRenaming(e,t){return!!this.configuring&&(this.renaming={kind:e,key:String(t)},this.requestComponentUpdate("view-rename"),!0)}cancelRenaming(){this.renaming=null,this.requestComponentUpdate("view-rename")}removeGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this._locateGroup(e);if(!t||!this.canChangeVisibility(t.group))return!1;for(const e of[...t.group.fields??[]])this.moveFieldToUnplaced(String(e.key));const n=String(e);this.layerDraft.groups[n]={...this.layerDraft.groups[n]??{},hidden:!0},t.group.hidden=!0;const i=this.sections.find(e=>(e.groups??[]).includes(t.group));return i&&(i.groups=(i.groups??[]).filter(e=>e!==t.group)),this.requestComponentUpdate("view-remove-group"),this.saveView()}removeSection(e){if(!this.configuring||!this.layerDraft)return!1;const t=String(e),n=this.sections.find(e=>String(e.key)===t);if(!n||!this.canChangeVisibility(n))return!1;if(this.sections.length<2)return!1;const i=this.sections.find(e=>e!==n);for(const e of[...n.groups??[]])this.moveGroup(String(e.key),String(i.key),Number.MAX_SAFE_INTEGER);return this.layerDraft.sections[t]={...this.layerDraft.sections[t]??{},hidden:!0},n.hidden=!0,this.sections=this.sections.filter(e=>e!==n),this.selectedSection===t&&(this.selectedSection=String(i.key)),this.requestComponentUpdate("view-remove-section"),this.saveView()}moveSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const n=String(e),i=this.sections.findIndex(e=>String(e.key)===n);if(i<0)return!1;const r=[...this.sections],[s]=r.splice(i,1),o=Math.max(0,Math.min(Number.isInteger(t)?t:r.length,r.length));return r.splice(o,0,s),!r.every((e,t)=>e===this.sections[t])&&(this.sections=r,this._writeOrder(this.layerDraft.sections,this.sections,{}),this.requestComponentUpdate("view-move-section"),this.saveView())}addGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this.sections.find(t=>String(t.key)===String(e))??this.sections[0];if(!t)return!1;const n=this._newEntryKey("group"),i={key:n,label:this.newGroupTitle,columns:1,fields:[],hidden:!1,rare:!1,editable:!0};return t.groups=[...t.groups??[],i],this._writeOrder(this.layerDraft.groups,t.groups,{section:String(t.key)}),this.layerDraft.groups[n]={...this.layerDraft.groups[n]??{},label:i.label,section:String(t.key),columns:1,hidden:!1},this.renaming={kind:"group",key:n},this.requestComponentUpdate("view-add-group"),this.saveView()}addSection(){if(!this.configuring||!this.layerDraft)return!1;const e=this._newEntryKey("section"),t={key:e,label:this.newSectionTitle,groups:[],hidden:!1,rare:!1};return this.sections=[...this.sections,t],this._writeOrder(this.layerDraft.sections,this.sections,{}),this.layerDraft.sections[e]={...this.layerDraft.sections[e]??{},label:t.label,hidden:!1},this.selectedSection=e,this.renaming={kind:"section",key:e},this.requestComponentUpdate("view-add-section"),this.saveView()}_newEntryKey(e){return`view-${e}-${Date.now().toString(36)}${Math.floor(46655*Math.random()).toString(36).padStart(3,"0")}`}toggleEntryHidden(e,t){if(!this.configuring||!this.layerDraft)return!1;const n={section:"sections",group:"groups",field:"fields"}[e];if(!n)return!1;const i=this._findEntry(e,t);if(!i||!this.canChangeVisibility(i))return!1;const r=!i.hidden,s=String(t);return this.layerDraft[n][s]={...this.layerDraft[n][s]??{},hidden:r},i.hidden=r,this.requestComponentUpdate("view-hidden"),this.saveView()}_findEntry(e,t){const n=String(t);for(const t of this.sections){if("section"===e&&String(t.key)===n)return t;for(const i of t.groups??[]){if("group"===e&&String(i.key)===n)return i;for(const t of i.fields??[])if("field"===e&&String(t.key)===n)return t}}return null}async saveView(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this._viewWriting??Promise.resolve();let t;this._viewWriting=new Promise(e=>{t=e});try{return await e,await this._saveViewNow()}finally{t()}}async _saveViewNow(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this.viewTarget,t=++this.viewEpoch,n=await this._raise("view.save",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)},view:E(this.layerDraft)},{stale:()=>t!==this.viewEpoch});return n?"applied"===n.answer?(this.entryErrors=new Map,this._storeLayer(e,n.revision??null,n.view??this.layerDraft),n.view?await this.load("view-normalised"):(this._setState("ready"),this.requestComponentUpdate("view-saved")),n):"conflict"===n.answer?(this._storeLayer(e,n.revision??null,n.view??null),this.message=n.message||this.viewConflictText,await this.load("view-conflict"),n):"refused"===n.answer?(this.entryErrors=new Map(Object.entries(n.entry_errors??{}).map(([e,t])=>[e,String(t)])),await this.load("view-refused"),n):(this._setState("error",n.message||(0,d.pageText)(L,"viewSaveFailedText",this)),n):null}_storeLayer(e,t,n){this.view&&(this.view.layers={...this.view.layers??{}},this.view.layers[e]={revision:t,view:n?E(n):null},this.layerDraft=this._layerCopy(e))}async resetView(){if(!this.canConfigureView)return null;this.resetAsked=!1,await(this._viewWriting??Promise.resolve());const e=this.viewTarget,t=++this.viewEpoch,n=await this._raise("view.reset",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)}},{stale:()=>t!==this.viewEpoch});return n?"applied"===n.answer||"conflict"===n.answer?("conflict"===n.answer&&(this.message=n.message||this.viewConflictText),this._storeLayer(e,n.revision??null,null),this.entryErrors=new Map,await this.load("view-reset"),n):(this._setState("error",n.message||(0,d.pageText)(L,"viewResetFailedText",this)),n):null}}(0,s.C3)(V,o),(0,s.l6)(V,o),V.define("sf-view-properties"),t()}catch(I){t(I)}})},"844bdc4d24eb"(e,t,n){n.d(t,{tm:()=>o});const i=Object.freeze(["eq","ne","in","not_in","empty","not_empty"]),r=e=>e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;function s(e,t){if(!e||"object"!=typeof e||Array.isArray(e))return null;for(const n of["all","any"]){if(!(n in e))continue;const i=e[n];if(!Array.isArray(i)||!i.length)return null;const r=i.map(e=>s(e,t));return r.includes(null)?null:"all"===n?r.every(Boolean):r.some(Boolean)}if("not"in e){const n=s(e.not,t);return null===n?null:!n}if("string"!=typeof e.field||!i.includes(e.op))return null;const n=(o=t.get(e.field),(Array.isArray(o)?o:[o]).map(r).filter(e=>null!=e&&""!==e).map(e=>String(e)));var o;if("empty"===e.op)return 0===n.length;if("not_empty"===e.op)return n.length>0;if("eq"===e.op||"ne"===e.op){const t=n.includes(String(r(e.value)));return"eq"===e.op?t:!t}if(!Array.isArray(e.value))return null;const a=e.value.map(e=>String(r(e))),l=n.some(e=>a.includes(e));return"in"===e.op?l:!l}function o(e,t){const n=e?.when&&"object"==typeof e.when?e.when:null,i=e=>n&&e in n?s(n[e],t):null,r=i("visible"),o=i("required"),a=i("enabled");return{visible:r??!0,required:o??!0===e?.required,enabled:a??!0}}},f44b979883f0(e,t,n){n.d(t,{Iv:()=>w,LI:()=>f,PD:()=>a,UD:()=>g,WQ:()=>p,dw:()=>m,e4:()=>s,lw:()=>d,nI:()=>o,uM:()=>h,zJ:()=>b});const i=/^([+-]?)(\d*)(?:[.,](\d*))?$/u,r=/[\s ']/gu;function s(e){if(null==e)return{ok:!0,value:null};if("number"==typeof e)return Number.isSafeInteger(e)?{ok:!0,value:String(e)}:{ok:!1};const t=String(e).replace(r,"");if(""===t)return{ok:!0,value:null};const n=i.exec(t);if(!n)return{ok:!1};const[,s,o,a]=n;if(""===o&&""===(a??""))return{ok:!1};const l=o.replace(/^0+(?=\d)/u,"")||"0",c=a??"",u=/^0*$/u.test(l+c);return{ok:!0,value:`${"-"!==s||u?"":"-"}${l}${c?`.${c}`:""}`}}function o(e){if(e&&"object"==typeof e&&"bigint"==typeof e.units)return e;const t=s(e);if(!t.ok||null===t.value)return null;const n=t.value.startsWith("-"),[i,r=""]=t.value.replace("-","").split(".");return{units:BigInt(i+r)*(n?-1n:1n),scale:r.length}}function a(e){const t=s(e);if(!t.ok||null===t.value)return 0;const n=t.value.indexOf(".");return-1===n?0:t.value.length-n-1}const l=new Map,c=e=>(l.has(e)||l.set(e,10n**BigInt(e)),l.get(e));function u(e,t){return e.scale===t?e:{units:e.units*c(t-e.scale),scale:t}}function d(e,t){return{units:e.units*t.units,scale:e.scale+t.scale}}function p(e,t){const n=Math.max(e.scale,t.scale);return{units:u(e,n).units+u(t,n).units,scale:n}}function h(e){return{units:e.units,scale:e.scale+2}}function f(e,t){if(e.scale<=t)return u(e,t);const n=c(e.scale-t),i=e.units<0n,r=i?-e.units:e.units;let s=r/n;return r%n*2n>=n&&(s+=1n),{units:i?-s:s,scale:t}}function g(e,t){const n=Math.max(e.scale,t.scale),i=u(e,n).units,r=u(t,n).units;return i===r?0:i<r?-1:1}function m(e){const t=e.units<0n,n=(t?-e.units:e.units).toString().padStart(e.scale+1,"0"),i=e.scale?n.slice(0,-e.scale):n,r=e.scale?n.slice(-e.scale):"",s=0n===e.units;return`${t&&!s?"-":""}${i}${r?`.${r}`:""}`}const v=new Map;function y(e){if(!v.has(e)){let t=" ",n=".";try{for(const i of new Intl.NumberFormat(e).formatToParts(12345.6))"group"===i.type&&(t=i.value),"decimal"===i.type&&(n=i.value)}catch{}v.set(e,{group:t,point:n})}return v.get(e)}function b(e,t,{minFraction:n=0}={}){const i=o(e);if(!i)return"";const r=m(i.scale<n?u(i,n):i),s=r.startsWith("-"),[a,l]=r.replace("-","").split("."),{group:c,point:d}=y(t);return`${s?"−":""}${a.replace(/\B(?=(\d{3})+(?!\d))/gu,c)}${l?`${d}${l}`:""}`}function w(e,t){const n=s(e);return n.ok&&null!==n.value?n.value.replace(".",y(t).point):""}},"62c5c417c97d"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{G:()=>l});var r=n("2a080a730149"),s=n("e5483002f3ea"),o=n("db94c32f22be"),a=e([r,s,o]);[r,s,o]=a.then?(await a)():a;function l(e,t,n,{disabled:i=!1}={}){const a=String(t.key??""),l={setFieldValue:(t,n)=>e.component.changeField(t,n),setFieldError:(t,n)=>e.component.reportFieldError(t,n),...e.canUploadFiles?{getFieldUploads:t=>e.component.getFieldUploads(t),startFieldUpload:(t,n)=>e.component.startFieldUpload(t,n),retryFieldUpload:(t,n)=>e.component.retryFieldUpload(t,n)}:{},...e.canPickRecords?{getFieldOptionsPage:t=>e.component.getFieldOptionsPage(t),getFieldOptionSearch:t=>e.component.getFieldOptionSearch(t),setFieldOptionSearch:(t,n)=>e.component.setFieldOptionSearch(t,n),loadFieldOptions:(t,n)=>e.component.loadFieldOptions(t,n)}:{}},c=(0,o.BE)(t,e.changed.has(a)&&n?e.changed.get(a):t.value,n,l,{node:e.component,size:e.size,viewHost:e.viewHost,disabled:i});if(null!==c)return c===r.nothing?r.html`<span class="sf-property-view-empty color-on-surface-variant">${e.emptyText}</span>`:c;const u=n?(0,s.z4)(t,e.changed.has(a)?e.changed.get(a):t.value,l,{size:e.size,...i?{disabled:!0}:{}}):(0,s.oX)(t,t.value,e.viewHost,{size:e.size}),d=["record","relation","user"].includes(t.propertyType||t.type)&&t.value&&"object"==typeof t.value;if(!n&&d&&u)return r.html`<span
|
|
588
|
+
`}const ht={string:ae,text:nt,html:it,integer:rt,number:rt,date:st,datetime:st,time:st,boolean:ot,choice:at,choices:lt,user:ct,record:ut,relation:ut,lookup:dt,file:pt,color:z,include:ue};function ft(e={},t,n,i={}){const r=e.propertyType||e.type||e.dataType,s=ht[r];if(!s)return null;const o=Qe;Qe=Ke(i);try{return s(e,t,n)}finally{Qe=o}}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.fieldRenderers={...window.SF.fieldRenderers||{},renderCellField:Y,renderEditField:Xe,renderFilterField:S,renderViewField:ft,FILTER_RENDERERS:k,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:ht,edit:Q,cell:V,filter:k}))};var t})},globalThis.document?.dispatchEvent?.(new CustomEvent("sf-field-renderers-ready"))),i()}catch(gt){i(gt)}})},dd6973f77245(e,t,n){n.d(t,{$:()=>a,C:()=>l});const i={0:"\\d",a:"\\p{L}","*":"[\\s\\S]"},r={0:e=>/\d/u.test(e),a:e=>/\p{L}/u.test(e),"*":()=>!0},s=e=>e.replace(/[\\^$.*+?()[\]{}|/]/gu,"\\$&");const o=new Map;function a(e){const t=e?.mask;return"string"==typeof t&&""!==t?t:null}function l(e,t,n="_"){const a=String(e??"");o.has(t)||o.set(t,function(e){let t="";const n=[];for(let o=0;o<e.length;o+=1){const a=e[o];"\\"===a?(o+=1,o<e.length&&(t+=s(e[o]),n.push({fixed:e[o]}))):"{"===a||"}"===a||"["===a||"]"===a||(i[a]?(t+=i[a],n.push({test:r[a]})):(t+=s(a),n.push({fixed:a})))}return{complete:new RegExp(`^${t}$`,"u"),tokens:n}}(t));const{complete:l,tokens:c}=o.get(t);return l.test(a)?"complete":0===function(e,t,n){let i=0,r=0;for(const s of e){for(;r<t.length&&void 0!==t[r].fixed&&t[r].fixed!==s;)r+=1;if(r>=t.length)break;const e=t[r];void 0!==e.fixed||s===n?r+=1:e.test(s)&&(i+=1,r+=1)}return i}(a,c,n)?"empty":"incomplete"}},fc654eb7fab0(e,t,n){n.d(t,{U:()=>r});const i=Object.freeze([{type:"string",label:{ru:"Строка",en:"String"},variants:[{id:"phone",label:{ru:"Телефон",en:"Phone"}},{id:"password",label:{ru:"Пароль",en:"Password"},writeOnly:!0}],params:["placeholder","mask","nullable","required","readonly"]},{type:"text",label:{ru:"Текст",en:"Text"},variants:[],params:["placeholder","required","readonly"]},{type:"html",label:{ru:"Форматированный текст",en:"Formatted text"},variants:[],params:["placeholder","required","readonly"]},{type:"integer",label:{ru:"Целое число",en:"Integer"},variants:[{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","required","readonly"]},{type:"number",label:{ru:"Число",en:"Number"},variants:[{id:"scale",label:{ru:"Шкала 0–100",en:"Scale 0–100"}},{id:"stepper",label:{ru:"Кнопками «−» и «+»",en:"With steppers"}}],params:["unit","min","max","step","precision","required","readonly"]},{type:"date",label:{ru:"Дата",en:"Date"},variants:[],params:["required","readonly"]},{type:"datetime",label:{ru:"Дата и время",en:"Date and time"},variants:[],params:["min","max","step","required","readonly"]},{type:"time",label:{ru:"Время",en:"Time"},variants:[],params:["min","max","step","required","readonly"]},{type:"boolean",label:{ru:"Да или нет",en:"Yes or no"},variants:[],params:["trueText","falseText","required","readonly"]},{type:"choice",label:{ru:"Одно из списка",en:"One of a list"},variants:[{id:"buttons",label:{ru:"Кнопками",en:"As buttons"}}],params:["options","badgeAppearance","size","required","readonly"]},{type:"choices",label:{ru:"Несколько из списка",en:"Several of a list"},variants:[{id:"badges",label:{ru:"Значками",en:"As badges"}},{id:"checklist",label:{ru:"Флажками",en:"As a checklist"}},{id:"select",label:{ru:"Выпадающим списком",en:"As a dropdown"}}],params:["options","badgeAppearance","required","readonly"]},{type:"user",label:{ru:"Пользователь",en:"User"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"record",label:{ru:"Запись",en:"Record"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"relation",label:{ru:"Связь",en:"Relation"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"lookup",label:{ru:"Из справочника",en:"From a reference list"},variants:[],params:["options","multiple","placeholder","searchPlaceholder","required","readonly"]},{type:"file",label:{ru:"Файл",en:"File"},variants:[{id:"image",label:{ru:"Изображение",en:"Image"}},{id:"image-card",label:{ru:"Изображение карточкой",en:"Image card"}},{id:"image-list",label:{ru:"Изображения списком",en:"Image list"}}],params:["accept","multiple","formats","uploadText","uploadSupportingText","uploadHint","required","readonly"]},{type:"color",label:{ru:"Цвет",en:"Colour"},variants:[],params:["swatches","required","readonly"]},{type:"include",label:{ru:"Код",en:"Code"},variants:[],params:["language","required","readonly"]},{type:"money",label:{ru:"Деньги",en:"Money"},set:"view",variants:[],params:["currency","min","max","required","readonly"]},{type:"percent",label:{ru:"Процент",en:"Percent"},set:"view",variants:[],params:["min","max","required","readonly"]},{type:"items",label:{ru:"Строки",en:"Rows"},set:"view",variants:[],params:["columns","minRows","maxRows","required","readonly"]},{type:"compound",label:{ru:"Составное",en:"Compound"},set:"view",variants:[],params:["parts","required","readonly"]},{type:"ru.requisites",label:{ru:"Реквизиты",en:"Requisites (Russia)"},set:"view",variants:[],params:["parts","required","readonly"]}]);function r(e,t){return{view:Boolean(t.view?.[e]),edit:Boolean(t.edit?.[e]),cell:t.cell?.[e]?"own":"text",filter:t.filter?.[e]?"own":"text"}}n.d(t,["u",0,i])},"5961360f41f4"(e,t,n){n.d(t,{f:()=>c});const i=Object.freeze(["main","tonal","outline"]),r=Object.freeze(["neutral","primary","secondary","tertiary","info","success","warning","error","on-surface"]),s=Object.freeze({danger:"error"}),o=Object.freeze(["1/3","1/2","1"]);function a(e){const t=String(e??"").trim().toLowerCase(),n=s[t]??t;return r.includes(n)?n:""}Object.freeze(r.flatMap(e=>i.filter(t=>!("on-surface"===e&&"tonal"===t)).flatMap(t=>o.map(n=>Object.freeze({type:t,scheme:e,size:n})))));const l=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function c(e={}){const t=e?.scheme??e?.color,n="string"==typeof t?t.trim():"",i=a(n);return i?{scheme:i,rootStyle:""}:l.test(n)?{scheme:"neutral",rootStyle:`--sf-badge--background-color: color-mix(in srgb, ${n} 24%, transparent); --sf-badge--color: var(--sf-on-surface)`}:{scheme:"neutral",rootStyle:""}}},"7623a90f1816"(e,t,n){n.a(e,async(e,t)=>{try{var i=n("deb1a4d61565"),r=n("5b7d7695b41b"),s=n("17828be41e75"),o=n("3ea81f4c3c20"),a=n("4284cc8c32e1"),l=n("99fb492b7fba"),c=n("d614908e644f"),u=n("1b42c5117087"),d=n("43090d1c8307"),p=n("18003344cff0"),h=n("40b137e60526"),f=n("844bdc4d24eb"),g=n("2f31b00ad99a"),m=e([i,r,d,p,h,g]);[i,r,d,p,h,g]=m.then?(await m)():m;var v=n.n(i);const y=["1.0.0","1.1.0","1.2.0","1.3.0","1.4.0","1.5.0","1.6.0","1.7.0","1.8.0","1.9.0","1.10.0","1.11.0","1.12.0","1.13.0","1.14.0","1.15.0","1.16.0","1.17.0"],b=["view","auto","edit","create"],w=20,x=["record","relation","user","lookup"],$=e=>Number.isInteger(e?.field_count)&&e.field_count>0&&(!Array.isArray(e.fields)||0===e.fields.length),k=(e,t)=>{const n=e=>String(e??"").split(".").map(e=>Number.parseInt(e,10)||0),[i,r]=[n(e),n(t)];for(let e=0;e<3;e+=1)if((i[e]??0)!==(r[e]??0))return(i[e]??0)>(r[e]??0);return!0},S="(min-width: 48rem)",T="14rem",_=5e3,A=[];function F(){return A[A.length-1]??null}function C(){A.forEach((e,t)=>{e.setAttribute("data-stack-depth",String(t)),e.toggleAttribute("data-stack-top",e===F()),e.requestComponentUpdate("stack")})}const z=e=>null===e||["string","number","boolean","undefined"].includes(typeof e)||"object"==typeof e&&(Array.isArray(e)||e.constructor===Object),E=e=>null==e?e:"object"==typeof e&&z(e)?Array.isArray(e)?e.map(e=>E(e)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,E(t)])):e,q=(e={})=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase()),t])),L={en:q(l.runtime),ru:q(c.runtime)},P=u.x,O=(0,r.elementFromManifest)(o,{base:v(),lang:{en:l,ru:c},source:"ru",aliases:a});class V extends O{static get props(){return{templateName:{attribute:"template",default:"default"},recordId:{attribute:"record-id",default:""},collection:{default:""},showRare:{attribute:"show-rare",type:Boolean,default:!1},size:{default:"1"},mode:{default:"auto"},emptyText:{attribute:"empty-text",default:"not filled in"},emptyRecordText:{attribute:"empty-record-text",default:"This record has nothing to show"},editText:{attribute:"edit-text",default:"edit"},saveText:{attribute:"save-text",default:"Save"},cancelText:{attribute:"cancel-text",default:"Cancel"},deleteText:{attribute:"delete-text",default:"Delete"},changedText:{attribute:"changed-text",default:"Fields changed"},errorsText:{attribute:"errors-text",default:"Errors"},conflictText:{attribute:"conflict-text",default:"The record changed; read it again"},sectionsLabel:{attribute:"sections-label",default:"Sections"},sectionsAs:{attribute:"sections-as",default:"list",values:["list","tabs"]},panel:{type:Boolean,default:!1},panelSize:{attribute:"panel-size",default:"1",values:["1/2","1","2","full"]},panelLabel:{attribute:"panel-label",default:""},panelWidth:{attribute:"panel-width",default:""},closeLabel:{attribute:"close-label",default:"Close"},copyLinkLabel:{attribute:"copy-link-label",default:"Copy link"},linkCopiedLabel:{attribute:"link-copied-label",default:"Link copied"},openFullLabel:{attribute:"open-full-label",default:"Open as a page"},configureText:{attribute:"configure-text",default:"Arrange the view"},doneConfiguringText:{attribute:"done-configuring-text",default:"Done"},resetViewText:{attribute:"reset-view-text",default:"Reset"},resetViewAskText:{attribute:"reset-view-ask-text",default:"Reset the whole view?"},cancelConfiguringText:{attribute:"cancel-configuring-text",default:"Cancel"},personalLayerText:{attribute:"personal-layer-text",default:"Personal"},viewProfileLabel:{attribute:"view-profile-label",default:"View"},addViewText:{attribute:"add-view-text",default:"Add a view"},newViewText:{attribute:"new-view-text",default:"New view"},deleteViewText:{attribute:"delete-view-text",default:"Remove the view"},lastSharedViewText:{attribute:"last-shared-view-text",default:"The only view everyone has"},sharedLayerText:{attribute:"shared-layer-text",default:"Everyone's"},widthText:{attribute:"width-text",default:"Full width"},fieldLabelText:{attribute:"field-label-text",default:"Name"},sectionIconText:{attribute:"section-icon-text",default:"Section glyph"},sectionIcons:{attribute:"section-icons",default:""},variantText:{attribute:"variant-text",default:"Template"},hintText:{attribute:"hint-text",default:"Hint"},hiddenText:{attribute:"hidden-text",default:"Hide"},configureHintText:{attribute:"configure-hint-text",default:"Drag fields between groups and onto a section on the left. Applied at once."},configureHintNarrowText:{attribute:"configure-hint-narrow-text",default:"Drag fields between groups. Applied at once."},fieldSettingsText:{attribute:"field-settings-text",default:"Field settings"},shownText:{attribute:"shown-text",default:"Shown"},showRareText:{attribute:"show-rare-text",default:"Show rare fields"},hideRareText:{attribute:"hide-rare-text",default:"Hide rare fields"},rareText:{attribute:"rare-text",default:"rare"},unplacedTitle:{attribute:"unplaced-title",default:"Not placed"},moveUpText:{attribute:"move-up-text",default:"Move up"},moveDownText:{attribute:"move-down-text",default:"Move down"},addFieldText:{attribute:"add-field-text",default:"Add a field"},inThisGroupText:{attribute:"in-this-group-text",default:"In this area"},renameText:{attribute:"rename-text",default:"Rename"},saveNameText:{attribute:"save-name-text",default:"Save the name"},cancelNameText:{attribute:"cancel-name-text",default:"Leave the name"},removeFieldText:{attribute:"remove-field-text",default:"Remove from this area"},removeGroupText:{attribute:"remove-group-text",default:"Remove this area"},removeSectionText:{attribute:"remove-section-text",default:"Remove this section"},addGroupText:{attribute:"add-group-text",default:"Add an area"},addSectionText:{attribute:"add-section-text",default:"Add a section"},newGroupTitle:{attribute:"new-group-title",default:"New area"},newSectionTitle:{attribute:"new-section-title",default:"New section"},noMatchText:{attribute:"no-match-text",default:"Nothing matches"},unplacedHintText:{attribute:"unplaced-hint-text",default:"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out."},viewConflictText:{attribute:"view-conflict-text",default:"The view changed and was read again"},viewDeniedText:{attribute:"view-denied-text",default:"You may not change this layer"},backLabel:{attribute:"back-label",default:"Back"},collectionLabel:{attribute:"collection-label",default:""},collectionIcon:{attribute:"collection-icon",default:""},favourite:{type:Boolean,default:!1},favouriteLabel:{attribute:"favourite-label",default:"Favourite"},menuLabel:{attribute:"menu-label",default:"More"},inheritedText:{attribute:"inherited-text",default:"by default"}}}constructor(){super(),this.hostPort=null,this.record=null,this.sections=[],this.selectedSection=null,this.renaming=null,this.namingView=!1,this.arrangementEntered=null,this.resetAsked=!1,this.epoch=0,this.groupReads=new Map,this.groupsReading=new Set,this.groupsRefused=new Map,this.groupEpoch=0,this.message="",this.editing=null,this.changed=new Map,this.errors=new Map,this.inputErrors=new Map,this.controlErrors=new Set,this.conflict=null,this.confirmation=null,this.optionPages=new Map,this.optionSearches=new Map,this.optionEpochs=new Map,this.uploads=new Map,this.view=null,this.configuring=!1,this._openedForDrag=!1,this.viewTarget="personal",this.layerDraft=null,this.entryErrors=new Map,this.viewEpoch=0,this.wide=!0,this.wideMedia=null,this.phoneSection=null}get recordId(){return this.getAttribute("record-id")||""}get collection(){return this.getAttribute("collection")||""}get showRare(){return this.getBooleanAttr("show-rare",!1)}get emptyRecordText(){return this.getAttribute("empty-record-text")||(0,d.pageText)(L,"emptyRecordText",this)}get isEmptyRecord(){if(!this.record)return!1;const e=this.sections??[];return!e.length||!e.some(e=>(e.groups??[]).some(e=>"related"===e.kind||(e.fields??[]).length>0))}get emptyText(){return this.getAttribute("empty-text")||(0,d.pageText)(L,"emptyText",this)}get editText(){return this.getAttribute("edit-text")||(0,d.pageText)(L,"editText",this)}get saveText(){return this.getAttribute("save-text")||(0,d.pageText)(L,"saveText",this)}get cancelText(){return this.getAttribute("cancel-text")||(0,d.pageText)(L,"cancelText",this)}get deleteText(){return this.getAttribute("delete-text")||(0,d.pageText)(L,"deleteText",this)}get unplaced(){const e=this.record?.unplaced;return Array.isArray(e)?e:[]}moveFieldToUnplaced(e,t){if(!this.configuring||!this.layerDraft)return!1;let n=null,i=null;for(const t of this.sections){for(const r of t.groups??[]){const t=(r.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){i=r,[n]=r.fields.splice(t,1);break}}if(n)break}if(!n)return!1;const r=this.record.unplaced??(this.record.unplaced=[]),s=Math.max(0,Math.min(Number.isInteger(t)?t:r.length,r.length));return r.splice(s,0,n),this._writeOrder(this.layerDraft.fields,r,{group:null}),i&&this._writeOrder(this.layerDraft.fields,i.fields??[],{group:String(i.key)}),this.requestComponentUpdate("view-move"),this.saveView()}get recordActions(){const e=this.record?.actions;return Array.isArray(e)?e.map(e=>String(e)):[]}async deleteRecord(){if("view"===this.mode||"create"===this.mode||!this.recordActions.includes("record.delete"))return!1;const e=await this._raise("record.delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null});return this.sfEmit("delete",{record_id:this.recordId||null,collection:this.collection||null,revision:this.record?.revision??null,answer:e?.answer??null}),!!e&&("applied"===e.answer?(this.closePanel("deleted"),!0):"cancelled"===e.reason?(this._setState("ready"),!1):(this.message=e.message||e.reason||this.viewDeniedText,this._setState("ready"),this.requestComponentUpdate("delete-refused"),!1))}get changedText(){return this.getAttribute("changed-text")||(0,d.pageText)(L,"changedText",this)}get errorsText(){return this.getAttribute("errors-text")||(0,d.pageText)(L,"errorsText",this)}get conflictText(){return this.getAttribute("conflict-text")||(0,d.pageText)(L,"conflictText",this)}get sectionsAs(){return this.getEnumAttr("sections-as",["list","tabs"],"list")}get sectionsLabel(){return this.getAttribute("sections-label")||(0,d.pageText)(L,"sectionsLabel",this)}get panel(){return this.getBooleanAttr("panel",!1)&&!this.full}get full(){return this.getBooleanAttr("full",!1)}set full(e){this.toggleAttribute("full",Boolean(e))}get panelOpen(){return this.panel&&!this.hidden&&"false"!==this.getAttribute("open")}syncPanelOpen(){const e=A.indexOf(this);this.panelOpen&&this.isConnected&&e<0?(A.push(this),C()):!this.panelOpen&&e>=0&&(A.splice(e,1),C()),this.requestComponentUpdate("panel-open")}get revision(){return void 0===this.record?.revision||null===this.record?.revision?"":String(this.record.revision)}get section(){return this.selectedSection??""}get panelSize(){return this.getAttribute("panel-size")||"1"}get panelLabel(){return this.getAttribute("panel-label")||""}get panelWidth(){return this.getAttribute("panel-width")||""}get size(){return"1/2"===this.getAttribute("size")?"1/2":"1"}get mode(){const e=this.getAttribute("mode");return b.includes(e)?e:"auto"}get mayEdit(){return"view"!==this.mode&&("create"===this.mode||(!k(this.hostPort?.version,"1.12.0")||this.recordActions.includes("record.edit")))}get openAll(){return"create"===this.mode||"edit"===this.mode&&this.mayEdit}get drawerWidth(){const e=this.panelWidth;if(!e)return null;if(!this.wide)return e;return`min(${"list"===this.sectionsAs&&((this.sections??[]).length>=2||this.configuring)?`calc(${e} + ${T} + var(--sf-space-4))`:e}, calc(100vw - ${this.edgeRoom}))`}get edgeControlWidth(){const e="1/2"===this.size?"1\\/2":"1";return`calc(var(--sf-text-height-${e}) + 2 * var(--sf-ui-${e}--space-y-tightness-default))`}get edgeRoom(){return`calc(${this.edgeControlWidth} + 2 * var(--sf-space-1\\/2))`}get edgeControlCount(){return 1+(this.address?1:0)+(this.canOpenFullPage?1:0)}get closeLabel(){return this.getAttribute("close-label")||(0,d.pageText)(L,"closeLabel",this)}get linkCopiedLabel(){return this.getAttribute("link-copied-label")||(0,d.pageText)(L,"linkCopiedLabel",this)}get copyLinkLabel(){return this.getAttribute("copy-link-label")||(0,d.pageText)(L,"copyLinkLabel",this)}get configureText(){return this.getAttribute("configure-text")||(0,d.pageText)(L,"configureText",this)}get resetViewAskText(){return this.getAttribute("reset-view-ask-text")||(0,d.pageText)(L,"resetViewAskText",this)}get cancelConfiguringText(){return this.getAttribute("cancel-configuring-text")||(0,d.pageText)(L,"cancelConfiguringText",this)}get doneConfiguringText(){return this.getAttribute("done-configuring-text")||(0,d.pageText)(L,"doneConfiguringText",this)}get resetViewText(){return this.getAttribute("reset-view-text")||(0,d.pageText)(L,"resetViewText",this)}get addViewText(){return this.getAttribute("add-view-text")||(0,d.pageText)(L,"addViewText",this)}get newViewText(){return this.getAttribute("new-view-text")||(0,d.pageText)(L,"newViewText",this)}get deleteViewText(){return this.getAttribute("delete-view-text")||(0,d.pageText)(L,"deleteViewText",this)}get lastSharedViewText(){return this.getAttribute("last-shared-view-text")||(0,d.pageText)(L,"lastSharedViewText",this)}get viewProfileLabel(){return this.getAttribute("view-profile-label")||(0,d.pageText)(L,"viewProfileLabel",this)}get personalLayerText(){return this.getAttribute("personal-layer-text")||(0,d.pageText)(L,"personalLayerText",this)}get sharedLayerText(){return this.getAttribute("shared-layer-text")||(0,d.pageText)(L,"sharedLayerText",this)}get widthText(){return this.getAttribute("width-text")||(0,d.pageText)(L,"widthText",this)}get variantText(){return this.getAttribute("variant-text")||(0,d.pageText)(L,"variantText",this)}get hintText(){return this.getAttribute("hint-text")||(0,d.pageText)(L,"hintText",this)}get hiddenText(){return this.getAttribute("hidden-text")||(0,d.pageText)(L,"hiddenText",this)}get configureHintText(){return this.getAttribute("configure-hint-text")||(0,d.pageText)(L,"configureHintText",this)}get configureHintNarrowText(){return this.getAttribute("configure-hint-narrow-text")||(0,d.pageText)(L,"configureHintNarrowText",this)}get fieldSettingsText(){return this.getAttribute("field-settings-text")||(0,d.pageText)(L,"fieldSettingsText",this)}get shownText(){return this.getAttribute("shown-text")||(0,d.pageText)(L,"shownText",this)}get showRareText(){return this.getAttribute("show-rare-text")||(0,d.pageText)(L,"showRareText",this)}get hideRareText(){return this.getAttribute("hide-rare-text")||(0,d.pageText)(L,"hideRareText",this)}get rareText(){return this.getAttribute("rare-text")||(0,d.pageText)(L,"rareText",this)}get unplacedTitle(){return this.getAttribute("unplaced-title")||(0,d.pageText)(L,"unplacedTitle",this)}get moveUpText(){return this.getAttribute("move-up-text")||(0,d.pageText)(L,"moveUpText",this)}get moveDownText(){return this.getAttribute("move-down-text")||(0,d.pageText)(L,"moveDownText",this)}get addFieldText(){return this.getAttribute("add-field-text")||(0,d.pageText)(L,"addFieldText",this)}get renameText(){return this.getAttribute("rename-text")||(0,d.pageText)(L,"renameText",this)}get saveNameText(){return this.getAttribute("save-name-text")||(0,d.pageText)(L,"saveNameText",this)}get cancelNameText(){return this.getAttribute("cancel-name-text")||(0,d.pageText)(L,"cancelNameText",this)}get removeFieldText(){return this.getAttribute("remove-field-text")||(0,d.pageText)(L,"removeFieldText",this)}get removeGroupText(){return this.getAttribute("remove-group-text")||(0,d.pageText)(L,"removeGroupText",this)}get removeSectionText(){return this.getAttribute("remove-section-text")||(0,d.pageText)(L,"removeSectionText",this)}get addGroupText(){return this.getAttribute("add-group-text")||(0,d.pageText)(L,"addGroupText",this)}get addSectionText(){return this.getAttribute("add-section-text")||(0,d.pageText)(L,"addSectionText",this)}get newGroupTitle(){return this.getAttribute("new-group-title")||(0,d.pageText)(L,"newGroupTitle",this)}get newSectionTitle(){return this.getAttribute("new-section-title")||(0,d.pageText)(L,"newSectionTitle",this)}get sectionIconText(){return this.getAttribute("section-icon-text")||(0,d.pageText)(L,"sectionIconText",this)}get fieldLabelText(){return this.getAttribute("field-label-text")||(0,d.pageText)(L,"fieldLabelText",this)}get inThisGroupText(){return this.getAttribute("in-this-group-text")||(0,d.pageText)(L,"inThisGroupText",this)}get noMatchText(){return this.getAttribute("no-match-text")||(0,d.pageText)(L,"noMatchText",this)}get currentGroups(){const e=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return e?.groups??[]}groupAt(e){return this.currentGroups.findIndex(t=>String(t.key)===String(e))}get groupCount(){return this.currentGroups.length}moveGroupBy(e,t){const n=this.groupAt(e);if(n<0)return!1;const i=n+t;if(i<0||i>=this.groupCount)return!1;const r=(this.sections??[]).find(e=>String(e.key)===this.selectedSection)??(this.sections??[])[0]??null;return!!r&&this.moveGroup(e,String(r.key),i)}fieldChoices(e){const t=String(e),n=this._addSession?.group===t?this._addSession:this._buildAddSession(t),i=new Set;for(const e of this._locateGroup(t)?.group?.fields??[])i.add(String(e.key));const r=this.addSearch.trim().toLowerCase(),s=[];for(const e of n.order)(!r||e.label.toLowerCase().includes(r)||e.key.toLowerCase().includes(r))&&s.push({...e,selected:i.has(e.key)});return s}_buildAddSession(e){const t=String(e),n=[],i=new Set,r=(e,t)=>{const r=String(e.key);i.has(r)||(i.add(r),n.push({key:r,label:String(e.label??e.key),group:t}))};for(const e of this._locateGroup(t)?.group?.fields??[])r(e,this.inThisGroupText);for(const e of this.unplaced??[])r(e,this.unplacedTitle);for(const e of this.sections??[])for(const n of e.groups??[]){if(String(n.key)===t||"related"===n.kind)continue;const e=String(n.label??n.key);for(const t of n.fields??[])r(t,e)}return{group:t,order:n}}startAddSession(e){return this._addSearch="",this._addSession=this._buildAddSession(e),this.requestComponentUpdate("add-session"),this._addSession}endAddSession(){this._addSession=null,this._addSearch="",this.requestComponentUpdate("add-session")}get addSearch(){return this._addSearch??""}setAddSearch(e){return this._addSearch=String(e??""),this.requestComponentUpdate("add-search"),this._addSearch}toggleFieldInGroup(e,t,n){return n?this.moveField(e,t,Number.MAX_SAFE_INTEGER):this.moveFieldToUnplaced(e)}get unplacedHintText(){return this.getAttribute("unplaced-hint-text")||(0,d.pageText)(L,"unplacedHintText",this)}get viewConflictText(){return this.getAttribute("view-conflict-text")||(0,d.pageText)(L,"viewConflictText",this)}get collectionLabel(){return this.getAttribute("collection-label")||""}get collectionIcon(){return this.getAttribute("collection-icon")||""}get favourite(){return this.hasAttribute("favourite")}get favouriteLabel(){return this.getAttribute("favourite-label")||(0,d.pageText)(L,"favouriteLabel",this)}get menuLabel(){return this.getAttribute("menu-label")||(0,d.pageText)(L,"menuLabel",this)}get inheritedText(){return this.getAttribute("inherited-text")||(0,d.pageText)(L,"inheritedText",this)}toggleFavourite(){const e=!this.favourite;return this.toggleAttribute("favourite",e),this.requestComponentUpdate("favourite"),this.dispatchEvent(new CustomEvent("sf-view-properties-favourite",{bubbles:!0,composed:!0,detail:{record_id:this.recordId||null,collection:this.collection||null,favourite:e}})),!0}get panelMenuItems(){const e=[];return this.canConfigureView&&!this.configuring&&e.push({id:"configure",name:this.configureText,icon:"tune"}),this.hasRare&&e.push({id:"show-rare",name:this.showRare?this.hideRareText:this.showRareText,icon:this.showRare?"unfold_less":"unfold_more"}),e}async openStandardMenu(e,{label:t,entries:n,select:i,align:r="end"}){if(!(e instanceof Element))return null;await(globalThis.SF?.Loader?.ensure?.(["sf-menu-context"]));let s=this._standardMenu;return s?.isConnected||(s=document.createElement("sf-menu-context"),s.setAttribute("popup",""),s.dataset.sfPropertyViewMenu="",s.addEventListener("sf-menu-context-select",e=>this._standardMenuSelect?.(e.detail?.id)),(this.closest("dialog[open]")||document.body).append(s),this._standardMenu=s),s.isOpen&&this._standardMenuAnchor===e?(s.close(),null):(s.setAttribute("aria-label",t??""),s.entries=n,this._standardMenuSelect=i,this._standardMenuAnchor=e,s.openFor(e,{align:r}))}viewProfileEntries(){const e=this.viewProfile;return this.viewProfiles.map(t=>({id:`view-profile:${t.id}`,text:t.label,kind:"radio",checked:t.id===e,icon:t.shared?"group":"person",caption:t.shared?this.sharedLayerText:this.personalLayerText}))}openPanelMenu(e){const t=[],n=this.viewProfiles;if(n.length>1&&!this.configuring){const e=n.find(e=>e.id===this.viewProfile);t.push({id:"view-profile",text:this.viewProfileLabel,icon:"view_sidebar",value:e?.label??"",submenu:this.viewProfileEntries()})}const i=this.panelMenuItems;t.length&&i.length&&t.push({type:"separator"}),t.push(...i.map(e=>({id:e.id,text:e.name,icon:e.icon})));const r=this.hostMenuEntries();return t.length&&r.length&&t.push({type:"separator"}),t.push(...r),t.length?this.openStandardMenu(e,{label:this.menuLabel,entries:t,select:e=>this._chooseStandardEntry(e)}):null}openViewProfileMenu(e){return this.openStandardMenu(e,{label:this.viewProfileLabel,entries:this.viewProfileEntries(),align:"start",select:e=>this._chooseStandardEntry(e)})}hostMenuElements(){const e=this.querySelector("[data-host-menu]")??this.panelContent?.()?.querySelector?.("[data-host-menu]");return e?[...e.children]:[]}hostMenuEntries(){return this.hostMenuElements().map((e,t)=>{const n=e.matches("a[href], button")?e:e.querySelector("a[href], button")??e,i=(e.getAttribute("text")??e.getAttribute("aria-label")??n.textContent??"").trim(),r=n.matches?.("a[href]")?n.getAttribute("href"):null;return{id:`host:${t}`,text:i,icon:e.getAttribute("icon")??e.getAttribute("icon-start")??e.dataset.icon??void 0,href:r||void 0,danger:"error"===e.getAttribute("scheme")||"true"===e.dataset.danger,disabled:e.hasAttribute("disabled")||!0===n.disabled}}).filter(e=>e.text)}_chooseStandardEntry(e){const t=String(e??"");if(t.startsWith("host:")){const e=this.hostMenuElements()[Number(t.slice(5))],n=e?.matches("a[href], button")?e:e?.querySelector("a[href], button")??e;return n?.matches?.("a[href]")||n?.click?.(),!0}return t.startsWith("view-profile:")?this.selectViewProfile(t.slice(13)):this.chooseMenuItem(t)}chooseMenuItem(e){return"configure"===e?this.startConfiguringView():"reset"===e?this.resetView():"show-rare"===e&&this.toggleShowRare()}get backLabel(){return this.getAttribute("back-label")||(0,d.pageText)(L,"backLabel",this)}get viewDeniedText(){return this.getAttribute("view-denied-text")||(0,d.pageText)(L,"viewDeniedText",this)}get openFullLabel(){return this.getAttribute("open-full-label")||(0,d.pageText)(L,"openFullLabel",this)}get address(){return this.record?.address??null}get canOpenFullPage(){return Boolean(this.address)&&Boolean(this.hostPort?.capabilities?.includes?.("record-open"))}static get observedAttributes(){return[...super.observedAttributes??[],"record-id","hidden","open","full"]}attributeChangedCallback(e,t,n){super.attributeChangedCallback?.(e,t,n),t!==n&&this.isConnected&&("record-id"===e&&this.hostPort&&this.load("record-id-changed"),"hidden"!==e&&"open"!==e&&"full"!==e||this.syncPanelOpen())}onConnected(){super.onConnected?.(),this.hasAttribute("data-state")||this.record||(this.setAttribute("data-state","loading"),this.setAttribute("aria-busy","true")),this.panelOpen&&!A.includes(this)&&(A.push(this),C()),this._onKeyDown=e=>{"Escape"===e.key&&this.panel&&(document.documentElement.dataset.sfPopoverOpen||F()===this&&(e.stopPropagation(),this.closePanel("escape")))},document.addEventListener("keydown",this._onKeyDown,!0),this._onSortableIntent=e=>{if(!this.configuring)return;const t=e.detail??{},[n,i]=String(t.to??"").split(":");i&&("section"===n?this.moveSection(t.item,t.index):"field"===n?this.moveField(t.item,i,t.index):"group"===n?this.moveGroup(t.item,i,t.index):"unplaced"===n&&this.moveFieldToUnplaced(t.item,t.index))},this.addEventListener("sf-sortable-intent",this._onSortableIntent),this._onDocumentSortableIntent=e=>{if(!this.panel||!this.configuring)return;const t=e.target?.closest?.(".sf-property-view-panel");t&&t.getAttribute("data-record-id")===String(this.recordId)&&this._onSortableIntent(e)},document.addEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState=e=>{if(!this.configuring)return;const t=e.detail?.state,n=globalThis.document?.querySelector?.(`.sf-property-view-panel[data-record-id="${this.recordId}"]`),i=n?.querySelector?.('[data-action="toggle-unplaced"]');if(!i)return;const r="true"===i.getAttribute("aria-expanded");if("picked"===t)return this._openedForDrag=!r,void(r||i.click());"dropped"!==t&&"cancelled"!==t||(this._openedForDrag&&"true"===i.getAttribute("aria-expanded")&&i.click(),this._openedForDrag=!1)},document.addEventListener("sf-sortable-state",this._onSortableState),this.wideMedia="function"==typeof globalThis.matchMedia?globalThis.matchMedia(S):null,this.wide=!this.wideMedia||this.wideMedia.matches,this._onWideChange=e=>{this.wide=e.matches,this.wide&&(this.phoneSection=null),this.requestComponentUpdate("viewport")},this.wideMedia?.addEventListener?.("change",this._onWideChange),this.hostPort&&(this.recordId||"create"===this.mode)?this.load("connected"):this.hostPort||this._requestHostPort()}_requestHostPort(){return!this.hostPort&&!this._portRequested&&(this._portRequested=!0,this.dispatchEvent(new CustomEvent("sf-host-port-request",{bubbles:!0,composed:!0,detail:{component:this,context:{owner:"property-view",record:this.recordId||null,group:null}}})),!0)}onDisconnected(){this._standardMenu?.close?.({restoreFocus:!1}),this._standardMenu?.remove(),this._standardMenu=null,this._portRequested=!1;const e=A.indexOf(this);e>=0&&(A.splice(e,1),C()),this._onKeyDown&&document.removeEventListener("keydown",this._onKeyDown,!0),this._onKeyDown=null,this.configuring=!1,this._bindSectionDropTarget(),this._onSortableIntent&&this.removeEventListener("sf-sortable-intent",this._onSortableIntent),this._onSortableIntent=null,this._onDocumentSortableIntent&&document.removeEventListener("sf-sortable-intent",this._onDocumentSortableIntent),this._onSortableState&&document.removeEventListener("sf-sortable-state",this._onSortableState),this._onDocumentSortableIntent=null,this._onWideChange&&this.wideMedia?.removeEventListener?.("change",this._onWideChange),this._onWideChange=null,this.wideMedia=null,super.onDisconnected?.()}panelContent(){const e=this.querySelector("sf-drawer")??this._panelDrawer??null,t=e?.querySelector?.(".sf-property-view-panel");if(t)return t;const n=this.getAttribute("record-id")||"";return[...document.querySelectorAll(".sf-property-view-panel")].find(e=>e.dataset.recordId===n)??null}setHostPort(e){if(!e||"function"!=typeof e.raise||!y.includes(e.version))throw new TypeError(`sf-view-properties requires a declared property-view host port: ${y.join(", ")}`);return this.hostPort=e,this.isConnected&&(this.recordId||"create"===this.mode)&&this.load("host-connected"),this}visible(e,{conditions:t=!0}={}){const n=t?this.fieldValues():null;return(Array.isArray(e)?e:[]).filter(e=>e&&!0!==e.hidden).filter(e=>this.showRare||!0!==e.rare).filter(e=>!n||!e.when||(0,f.tm)(e,n).visible)}fieldValues(){const e=new Map,t=t=>{if(!t||void 0===t.key||null===t.key)return;const n=String(t.key);e.set(n,this.changed.has(n)?this.changed.get(n):t.value)};for(const e of this.sections??[])for(const n of e?.groups??[])(n?.fields??[]).forEach(t);return this.unplaced.forEach(t),e}conditionedField(e,t=this.fieldValues()){if(!e?.when)return e;const n=(0,f.tm)(e,t);return{...e,required:n.required,readonly:!0===e.readonly||!n.enabled}}_hiddenByCondition(){const e=this.fieldValues(),t=new Set,n=n=>{n?.when&&!(0,f.tm)(n,e).visible&&t.add(String(n.key))};for(const e of this.sections??[])for(const t of e?.groups??[])(t?.fields??[]).forEach(n);return this.unplaced.forEach(n),t}_savedValues(){const e=this._hiddenByCondition();return Object.fromEntries([...this.changed].filter(([t])=>!e.has(t)))}get viewHost(){const e=this.hostPort??null;if(this._viewHost?.host===e)return this._viewHost.view;const t=Object.create(e&&"object"==typeof e?e:null);return Object.assign(t,{formatFieldValue:(t,n)=>{const i=e?.formatFieldValue?.(t,n);if("string"==typeof i)return i;const r=t?.propertyType??t?.property_type??t?.type??t?.dataType;return(0,g.x)(r,n,this)||void 0}}),this._viewHost={host:e,view:t},t}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,hostPort:this.hostPort,viewHost:this.viewHost,size:this.size,mode:this.mode,mayEdit:this.mayEdit,openAll:this.openAll,createText:(0,d.pageText)(L,"createText",this),emptyText:this.emptyText,emptyRecordText:this.emptyRecordText,isEmptyRecord:this.isEmptyRecord,loading:"loading"===this.getAttribute("data-state")&&!this.record,panel:this.panel,panelOpen:this.panelOpen,recordLabel:this.record?.label?String(this.record.label):"",loadFailure:this.record?null:this.loadFailure??null,editText:this.editText,saveText:this.saveText,cancelText:this.cancelText,deleteText:this.deleteText,recordActions:this.recordActions,changedText:this.changedText,errorsText:this.errorsText,sectionsLabel:this.sectionsLabel,sectionsAs:this.sectionsAs,sections:this.sections,selectedSection:this.selectedSection,editing:this.editing,changed:this.changed,errors:this.inputErrors.size?new Map([...this.errors,...this.inputErrors]):this.errors,inputsInvalid:this.inputErrors.size>0,controlErrors:this.controlErrors,canPickRecords:this.canPickRecords,canUploadFiles:this.canUploadFiles,hostSlot:e=>this.getSlotContent(e),hasHostSlot:e=>this.hasSlotContent(e),address:this.address,stackDepth:this.stackDepth,drawerWidth:this.drawerWidth,sectionsWidth:T,isTopPanel:this.isTopPanel,conflict:this.conflict,confirmation:this.confirmation,confirmSaveText:(0,d.pageText)(L,"confirmSaveText",this),keepEditingText:(0,d.pageText)(L,"keepEditingText",this),message:this.message,visible:e=>this.visible(e),conditionedField:e=>this.conditionedField(e),fieldDisabled:e=>this.fieldDisabled(e),canConfigureView:this.canConfigureView,configuring:this.configuring,unplaced:this.unplaced,viewTarget:this.viewTarget,editableLayers:this.editableLayers,viewProfiles:this.viewProfiles,viewProfile:this.viewProfile,canDeleteViewProfile:e=>this.canDeleteViewProfile(e),layerDenied:e=>this.layerDenied(e),canChangeVisibility:e=>this.canChangeVisibility(e),entryError:(e,t)=>this.entryError(e,t),configureText:this.configureText,doneConfiguringText:this.doneConfiguringText,resetViewText:this.resetViewText,resetViewAskText:this.resetViewAskText,cancelConfiguringText:this.cancelConfiguringText,resetAsked:this.resetAsked,personalLayerText:this.personalLayerText,viewProfileLabel:this.viewProfileLabel,addViewText:this.addViewText,newViewText:this.newViewText,deleteViewText:this.deleteViewText,lastSharedViewText:this.lastSharedViewText,sharedLayerText:this.sharedLayerText,widthText:this.widthText,fieldLabelText:this.fieldLabelText,sectionIcons:this.sectionIcons,sectionIconChoices:this.sectionIconChoices,sectionIconText:this.sectionIconText,variantText:this.variantText,hintText:this.hintText,hiddenText:this.hiddenText,configureHintText:this.wide?this.configureHintText:this.configureHintNarrowText,fieldSettingsText:this.fieldSettingsText,shownText:this.shownText,showRareText:this.showRareText,hideRareText:this.hideRareText,rareText:this.rareText,unplacedTitle:this.unplacedTitle,moveUpText:this.moveUpText,moveDownText:this.moveDownText,addFieldText:this.addFieldText,canOpenFullPage:this.canOpenFullPage,groupAt:e=>this.groupAt(e),groupCount:this.groupCount,fieldChoices:e=>this.fieldChoices(e),addSearch:this.addSearch,inThisGroupText:this.inThisGroupText,renameText:this.renameText,saveNameText:this.saveNameText,cancelNameText:this.cancelNameText,removeFieldText:this.removeFieldText,removeGroupText:this.removeGroupText,removeSectionText:this.removeSectionText,addGroupText:this.addGroupText,addSectionText:this.addSectionText,newGroupTitle:this.newGroupTitle,newSectionTitle:this.newSectionTitle,renaming:this.renaming,namingView:this.namingView,noMatchText:this.noMatchText,unplacedHintText:this.unplacedHintText,panelMenuItems:this.panelMenuItems,collectionLabel:this.collectionLabel,collectionIcon:this.collectionIcon,favourite:this.favourite,favouriteLabel:this.favouriteLabel,menuLabel:this.menuLabel,addressUrl:this.addressUrl??this.address,copyFeedbackMs:_,linkCopiedLabel:this.linkCopiedLabel,closeLabel:this.closeLabel,copyLinkLabel:this.copyLinkLabel,openFullLabel:this.openFullLabel,inheritedText:this.inheritedText,wide:this.wide,edgeControlWidth:this.edgeControlWidth,edgeControlCount:this.edgeControlCount,phoneSection:this.phoneSection,phoneSectionLabel:this.phoneSectionLabel,backLabel:this.backLabel})}template(){return(0,h.$)(this.templateContext())}sfAwaitingData(){return"skeleton"===this.getAttribute("data-sf-first-paint")&&!this.panel&&(!this.record&&!this.loadFailure&&"error"!==this.getAttribute("data-state"))}_setState(e,t=""){const n="loading"===e&&"loading"===this.getAttribute("data-state")&&!this.record;this.setAttribute("data-state",e),this.setAttribute("aria-busy","loading"===e?"true":"false"),this.message=t,n||this.requestComponentUpdate("state"),this.dispatchEvent(new CustomEvent("sf-view-properties-state",{bubbles:!0,composed:!0,detail:{state:e,message:t}}))}async _raise(e,t,{stale:n=()=>!1}={}){if(!this.hostPort)return this._setState("error",(0,d.pageText)(L,"statePortNotConnected",this)),{answer:"unavailable",reason:"port-not-connected"};try{const i=await this.hostPort.raise(e,E(t),{});if(!this.isConnected||n())return null;if(!i||!["applied","conflict","refused","unavailable"].includes(i.answer))throw new TypeError("Host answer is not a declared port answer");return"applied"===i.answer&&Array.isArray(i.effects)&&i.effects.length&&globalThis.SF?.Composition?.publishEffects?.(i.effects,{origin:this}),i}catch(e){return!this.isConnected||n()?null:(this._setState("error",(0,d.pageText)(L,"stateLoadFailed",this)),{answer:"unavailable",reason:"host-threw",message:String(e?.message||e)})}}get readsByGroup(){return Boolean(this.hostPort?.capabilities?.includes("group-load"))&&"create"!==this.mode}async load(e="requested"){this._setState("loading",(0,d.pageText)(L,"stateLoading",this)),this.loadFailure=null;const t=++this.epoch,n="create"===this.mode,i=this.readsByGroup;i&&(this.groupEpoch+=1,this.groupReads=new Map,this.groupsReading=new Set);const r=i?await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,group:null,reason:e},{stale:()=>t!==this.epoch}):await this._raise("record.load",{record_id:n?null:this.recordId||null,collection:this.collection||null,reason:e,...n?{mode:"create"}:{}},{stale:()=>t!==this.epoch});if(!r)return null;if("applied"!==r.answer&&!n&&!this.recordId)return r;if("applied"!==r.answer)return this.loadFailure={kind:"refused"===r.answer?"no-access":"error",text:r.message||""},this._setState("error",r.message||(0,d.pageText)(L,"stateUnavailable",this)),this.sfEmit("failed",{reason:String(r.reason??""),message:String(r.message??"")}),r;this.record=i?{...r.record??{},revision:r.revision??r.record?.revision??null}:r.record??null,this.sections=[],this._takeSections(this.record),this.view=r.record?.view??null;const s=this.editableLayers;s.includes(this.viewTarget)||(this.viewTarget=s[0]??"personal"),s.length||(this.configuring=!1),this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this.entryErrors=new Map;const o=this.sections.some(e=>String(e.key)===this.selectedSection),a=i&&void 0!==r.group&&null!==r.group?this.sections.find(e=>(e.groups??[]).some(e=>String(e.key)===String(r.group))):null;return o||(this.selectedSection=a?String(a.key):this.sections.length?String(this.sections[0].key):null),this._setState("ready"),i&&this._readShownGroups("started"),r}_takeSections(e){if(!Array.isArray(e?.sections))return;const t=E(e.sections);if(!this.readsByGroup)return void(this.sections=t);const n=void 0===e.revision||null===e.revision?"":String(e.revision),i=new Map(this.sections.flatMap(e=>(e.groups??[]).map(e=>[String(e.key),e])));for(const e of t){const t=Array.isArray(e.groups)?e.groups:[];t.forEach((e,r)=>{const s=String(e.key);if(!$(e))return void this.groupReads.set(s,n);const o=i.get(s);o&&this.groupReads.has(s)&&(t[r]={...e,fields:o.fields})})}this.sections=t}_shownGroups(){return(this.openAll||this.configuring?this.sections:this.sections.filter(e=>String(e.key)===this.selectedSection)).flatMap(e=>(e.groups??[]).map(t=>({section:String(e.key),group:String(t.key)})))}_readShownGroups(e="started",{force:t=!1}={}){if(!this.readsByGroup||!this.record)return[];const n=this.revision,i=[];for(const{section:r,group:s}of this._shownGroups())this.groupsReading.has(s)||this.groupsRefused.get(s)!==n&&(t||this.groupReads.get(s)!==n)&&i.push(this._readGroup(r,s,e));return i}async _readGroup(e,t,n){const i=this.groupEpoch;this.groupsReading.add(t),this.requestComponentUpdate("group-reading");const r=await this._raise("group.load",{record_id:this.recordId||null,collection:this.collection||null,section:e,group:t,reason:n},{stale:()=>i!==this.groupEpoch});if(i!==this.groupEpoch)return null;if(this.groupsReading.delete(t),!r)return null;if("refused"===r.answer&&"unknown-group"===r.reason){const e=this.revision;return this.groupsRefused.get(t)===e||(this.groupsRefused.set(t,e),await this.load("requested")),r}if("applied"!==r.answer)return this.requestComponentUpdate("group-reading"),r;const s=r.revision??r.record?.revision??this.record?.revision??null;return this.record={...this.record,...r.record??{},revision:s},this._takeSections(this.record),this.requestComponentUpdate("group-read"),r}isGroupReading(e){return this.groupsReading.has(String(e))}async _rereadAfterConflict(e){if(this.readsByGroup)return void 0!==e?.revision&&null!==e.revision&&this.record&&(this.record={...this.record,revision:e.revision}),Promise.all(this._readShownGroups("requested",{force:!0}));const t=this.epoch,n=await this._raise("record.load",{record_id:this.recordId||null,collection:this.collection||null,reason:"requested"},{stale:()=>t!==this.epoch});return n&&"applied"===n.answer&&n.record?(this.record=n.record,this._takeSections(n.record),this.requestComponentUpdate("conflict-reread"),n):n}get canUploadFiles(){return Boolean(this.hostPort?.capabilities?.includes("field-upload"))}getFieldUploads(e){return this.uploads.get(String(e.key??""))??[]}async startFieldUpload(e,t){const n=String(e.key??""),i=Array.isArray(t)?t:[];if(!i.length)return null;this.uploads.set(n,[...this.getFieldUploads(e),...i]),this.requestComponentUpdate("uploads");for(const t of i){const i=await this._raise("field.upload",{record_id:this.recordId||null,collection:this.collection||null,field:n,file:t.file??t},{stale:()=>!this.uploads.has(n)});if(!i)return null;const r=this.getFieldUploads(e);if("applied"===i.answer&&i.file){const s=this.changed.has(n)?this.changed.get(n):e.value,o=Array.isArray(s)?s:s?[s]:[];this.changed.set(n,[...o,i.file]),this.uploads.set(n,r.filter(e=>e!==t)),this.errors.delete(n)}else this.uploads.set(n,r.map(e=>e===t?{...e,state:"error",errorMessage:i.message||i.reason||""}:e)),"refused"===i.answer&&i.reason&&this.errors.set(n,String(i.message||i.reason));this.requestComponentUpdate("uploads")}return this}retryFieldUpload(e,t){const n=String(e.key??""),i=this.getFieldUploads(e),r=i[Number(t)];return r?(this.uploads.set(n,i.filter(e=>e!==r)),this.startFieldUpload(e,[r])):null}async openReference(e,t){if(!t||"object"!=typeof t)return null;const n=await this._raise("record.open",{record_id:this.recordId||null,collection:this.collection||null,field:String(e.key??""),value:t},{stale:()=>!this.isConnected});return this.sfEmit("open",{field:String(e.key??""),value:t,answer:n?.answer??null}),n}get stackDepth(){const e=A.indexOf(this);return e<0?0:e}get isTopPanel(){return F()===this}closePanel(e="close"){this._commitFocusedEntry();const t=this.unsavedFields;return this.sfEmit("close",{reason:e,record_id:this.recordId||null,unsaved_fields:t},{cancelable:!0})?{outcome:"applied"}:{outcome:"refused",reason:"prevented"}}get unsavedFields(){return new Set([...this.changed.keys(),...this.inputErrors.keys()]).size}_commitFocusedEntry(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;if(!e||"function"!=typeof e.blur)return;const t=this.panel?this.panelContent():null;(this.contains(e)||t?.contains(e))&&e.blur()}get addressUrl(){const e=this.address;if(!e)return null;try{return new URL(String(e),globalThis.location?.href).href}catch{return String(e)}}copyControl(){return[...document.querySelectorAll('sf-button-copy[data-action="copy-link"]')].find(e=>e.propertyView===this)??null}get addressCopied(){return"success"===this.copyControl()?.state?.phase}announceAddressCopy(e){const t=this.address;return this.dispatchEvent(new CustomEvent("sf-view-properties-address-copy",{bubbles:!0,composed:!0,detail:{address:t,url:this.addressUrl??t,copied:e,record_id:this.recordId||null}})),e}async copyAddress(){if(!this.address)return null;const e=this.copyControl();return e?.copy?Boolean(await e.copy()):null}openFullPage(){const e=this.address;return e?(this.sfEmit("open-full",{id:this.recordId||null,address:e,record_id:this.recordId||null}),this):null}openPhoneSection(e){const t=String(e);return!!this.sections.some(e=>String(e.key)===t)&&(this.phoneSection=t,this.selectSection(t),this.requestComponentUpdate("phone-section"),!0)}closePhoneSection(){return null!==this.phoneSection&&(this.phoneSection=null,this.requestComponentUpdate("phone-section"),!0)}get phoneSectionLabel(){const e=this.sections.find(e=>String(e.key)===this.phoneSection);return e?String(e.label??e.key):""}selectSection(e){return this.selectedSection=String(e),this.requestComponentUpdate("section"),this._readShownGroups("started"),this}get canPickRecords(){return Boolean(this.hostPort?.capabilities?.includes("field-options"))}getFieldOptionsPage(e){return this.optionPages.get(String(e.key??""))??null}getFieldOptionSearch(e){return this.optionSearches.get(String(e.key??""))??""}setFieldOptionSearch(e,t){return this.optionSearches.set(String(e.key??""),String(t??"")),this}async loadFieldOptions(e,{cursor:t=null,search:n="",quiet:i=!1}={}){const r=String(e.key??""),s=this.optionPages.get(r),o=t&&Array.isArray(s?.items)?s.items:[];this.optionPages.set(r,{items:o,status:"loading",quiet:i,nextCursor:s?.nextCursor??null}),this.requestComponentUpdate("options");const a=this.epoch,l=(this.optionEpochs.get(r)??0)+1;this.optionEpochs.set(r,l);const c=await this._raise("field.options",{record_id:this.recordId||null,collection:this.collection||null,field:r,cursor:t,search:String(n??""),...k(this.hostPort?.version,"1.14.0")?{...e.source?{source:String(e.source)}:{},limit:w}:{}},{stale:()=>a!==this.epoch||l!==this.optionEpochs.get(r)});if(!c)return null;if("applied"!==c.answer){const e="refused"===c.answer;return this.optionPages.set(r,{items:o,status:e?"unsupported":"error",quiet:!1,nextCursor:null}),this.requestComponentUpdate("options"),c}const u=c.options_page??{},d=Array.isArray(u.items)?u.items:[];return this.optionPages.set(r,{items:t?[...o,...d]:d,status:"ready",quiet:!1,nextCursor:u.next_cursor??null,total:u.total??null}),this.requestComponentUpdate("options"),c}changeField(e,t){const n=String(e.key??""),i=Object.hasOwn(e??{},"value")&&void 0!==t&&JSON.stringify(t)===JSON.stringify(e.value??null);return void 0===t||i?this.changed.delete(n):this.changed.set(n,t),this.errors.delete(n),this.confirmation=null,this.requestComponentUpdate("changed"),this}_clearInputs(){this.inputErrors.clear(),this.controlErrors.clear()}reportFieldError(e,t){const n=String(e?.key??"");if(!n)return this;const i=this.inputErrors.get(n);return t?(this.inputErrors.set(n,String(t)),this.controlErrors.add(n)):this.controlErrors.has(n)&&(this.inputErrors.delete(n),this.controlErrors.delete(n)),this.inputErrors.get(n)!==i&&this.requestComponentUpdate("errors"),this}fieldDisabled(e,t=this.fieldValues()){return Boolean(e?.when)&&!(0,f.tm)(e,t).enabled}_inputsInvalid(){return this.inputErrors.size?(this.requestComponentUpdate("errors"),{answer:"refused",reason:"input_invalid",errors:Object.fromEntries(this.inputErrors)}):null}_referenceFields(e,t){const n=this.sections.find(t=>String(t.key)===String(e)),i=this.visible(n?.groups).find(e=>String(e.key)===String(t));return this.visible(i?.fields,{conditions:!1}).filter(e=>x.includes(e.propertyType||e.type)).filter(e=>!("lookup"===(e.propertyType||e.type)&&Array.isArray(e.options)&&e.options.length>0))}editGroup(e,t){if(!this.mayEdit)return this;if(this.editing={section:String(e),group:String(t)},this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this.canPickRecords)for(const n of this._referenceFields(e,t))this.optionPages.has(String(n.key??""))||this.loadFieldOptions(n,{cursor:null,search:"",quiet:!0});return this}cancelEdit(){if(this.openAll)return this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode}})),this.panel?(this.closePanel("cancelled"),this):(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),this);const e=this.editing;return this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this.confirmation=null,this.requestComponentUpdate("editing"),e&&this.dispatchEvent(new CustomEvent("sf-view-properties-cancel",{bubbles:!0,composed:!0,detail:{mode:this.mode,scope:"group",section:e.section,group:e.group}})),this}announceSaved(e){const t=this.recordId||e?.record_id||e?.record?.record_id||null,n=e?.revision??e?.record?.revision??this.record?.revision??null;this.sfEmit("saved",{id:t,revision:null===n?"":String(n)})}async saveGroup({confirm:e=null}={}){if(this.openAll)return this.saveAll({confirm:e});if(this.editing&&this.inputErrors.size)return this._inputsInvalid();if(!this.editing||0===this.changed.size)return null;const t=this._savedValues();if(!Object.keys(t).length)return null;this.confirmation=null;const n=++this.epoch,i=await this._raise("group.save",{record_id:this.recordId||null,collection:this.collection||null,section:this.editing.section,group:this.editing.group,values:t,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>n!==this.epoch});return i?this._askedToConfirm(i)?i:"applied"===i.answer?(this.record=i.record?{...i.record,revision:i.revision??i.record.revision}:{...this.record,revision:i.revision??this.record?.revision??null},this._takeSections(this.record),this.editing=null,this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,this._setState("ready"),this.announceSaved(i),i):"conflict"===i.answer?(this.conflict=i.message||this.conflictText,this.requestComponentUpdate("conflict"),await this._rereadAfterConflict(i),i):"refused"===i.answer&&"unknown-group"===i.reason?(await this.load("requested"),i):"refused"===i.answer?(this.errors=new Map(Object.entries(i.errors??{}).map(([e,t])=>[e,String(t)])),this.requestComponentUpdate("errors"),i):(this._setState("error",i.message||(0,d.pageText)(L,"saveFailedText",this)),i):null}async saveAll({confirm:e=null}={}){if(this.inputErrors.size)return this._inputsInvalid();if("create"!==this.mode&&0===this.changed.size)return null;const t="create"===this.mode,n=this._savedValues();if(!t&&!Object.keys(n).length)return null;this.confirmation=null;const i=++this.epoch,r=t?await this._raise("record.create",{collection:this.collection||null,values:n},{stale:()=>i!==this.epoch}):await this._raise("record.save",{record_id:this.recordId||null,collection:this.collection||null,values:n,revision:this.record?.revision??null,...e?{confirm:e}:{}},{stale:()=>i!==this.epoch});if(!r)return null;if(!t&&this._askedToConfirm(r))return r;if("applied"===r.answer){if(this.changed.clear(),this._clearInputs(),this.errors.clear(),this.conflict=null,t){const e=r.record_id??r.record?.record_id??null;return this.dispatchEvent(new CustomEvent("sf-view-properties-created",{bubbles:!0,composed:!0,detail:{record_id:e,collection:this.collection||null}})),null!==e&&(this.setAttribute("record-id",String(e)),this.setAttribute("mode","auto"),r.record?(this.record=r.record,this._takeSections(r.record),this.view=r.record.view??this.view,this._setState("ready")):await this.load("created")),r}return this.record=r.record??this.record,this._takeSections(r.record),this._setState("ready"),this.announceSaved(r),r}return"conflict"===r.answer?(this.conflict=r.message||this.conflictText,this.requestComponentUpdate("conflict"),r):"refused"===r.answer?(this.errors=new Map(Object.entries(r.errors??{}).map(([e,t])=>[e,String(t)])),!this.errors.size&&r.message&&(this.conflict=r.message),this.requestComponentUpdate("errors"),r):(this._setState("error",r.message||(0,d.pageText)(L,"saveFailedText",this)),r)}_askedToConfirm(e){const t=e?.confirm;return!("refused"!==e?.answer||"confirm_required"!==e.reason||!t||"string"!=typeof t.digest||!t.digest)&&(this.confirmation={text:String(t.summary||e.message||""),digest:t.digest},this.requestComponentUpdate("confirmation"),!0)}confirmSave(){const e=this.confirmation?.digest;return e?this.openAll?this.saveAll({confirm:e}):this.saveGroup({confirm:e}):Promise.resolve(null)}cancelConfirmation(){return this.confirmation=null,this.requestComponentUpdate("confirmation"),this}get canConfigureView(){return"view"!==this.mode&&(Boolean(this.hostPort?.capabilities?.includes?.("view-settings"))&&Boolean(this.view)&&this.editableLayers.length>0)}get viewProfiles(){const e=this.view?.profiles;return Array.isArray(e)?e.filter(e=>e&&"string"==typeof e.id&&e.id):[]}get viewProfile(){const e=this.view?.profile;return"string"==typeof e&&e?e:this.viewProfiles[0]?.id??null}canDeleteViewProfile(e){const t=this.viewProfiles,n=t.find(t=>t.id===String(e??""));return!!n&&(!n.shared||t.filter(e=>e.shared).length>1)}createViewProfile(e,{shared:t=!1}={}){const n=String(e??"").trim();return n?(this.namingView&&(this.namingView=!1,this.requestComponentUpdate("view-naming")),this._viewProfileIntent("view.create",{label:n,shared:Boolean(t),view:this.layerDraft??this._layerCopy(this.viewTarget)})):null}startNamingView(){return this.namingView=!0,this.requestComponentUpdate("view-naming"),!0}cancelNamingView(){this.namingView=!1,this.requestComponentUpdate("view-naming")}renameViewProfile(e,t){const n=String(t??"").trim(),i=String(e??"");return n&&i&&this.viewProfiles.some(e=>e.id===i)?this._viewProfileIntent("view.rename",{profile:i,label:n}):null}deleteViewProfile(e){const t=String(e??"");return this.canDeleteViewProfile(t)?this._viewProfileIntent("view.delete",{profile:t}):null}async _viewProfileIntent(e,t){const n=++this.epoch,i=await this._raise(e,{record_id:this.recordId||null,collection:this.collection||null,...t},{stale:()=>n!==this.epoch});return i?"applied"!==i.answer?(this._setState("error",i.message||this.viewDeniedText),i):(this.record=i.record??this.record,this._takeSections(i.record),this.view=i.record?.view??this.view,this.layerDraft=this.configuring?this._layerCopy(this.viewTarget):null,this._setState("ready"),this.requestComponentUpdate("profiles"),i):null}async selectViewProfile(e){const t=String(e??"");if(!t||t===this.viewProfile)return null;if(!this.viewProfiles.some(e=>e.id===t))return null;const n=++this.epoch,i=await this._raise("view.profile",{record_id:this.recordId||null,collection:this.collection||null,profile:t},{stale:()=>n!==this.epoch});return i?"applied"!==i.answer?(this._setState("error",i.message||this.viewDeniedText),i):(this.record=i.record??this.record,this._takeSections(i.record),this.view=i.record?.view??this.view,this.editing=null,this.changed.clear(),this._clearInputs(),this._setState("ready"),this.configuring&&this.setViewTarget(this._layerOfProfile()),this.requestComponentUpdate("profile"),i):null}get editableLayers(){const e=this.view?.editable;return Array.isArray(e)?e.filter(e=>"personal"===e||"shared"===e):[]}layerDenied(e){return this.editableLayers.includes(e)?null:this.view?.denied?.[e]||this.viewDeniedText}_emptyLayer(){return{schema_version:1,sections:{},groups:{},fields:{}}}_layerCopy(e){const t=this.view?.layers?.[e]?.view;return t?E(t):this._emptyLayer()}_layerRevision(e){const t=this.view?.layers?.[e];return t?t.revision??null:null}toggleShowRare(){return this.toggleAttribute("show-rare",!this.showRare),this.requestComponentUpdate("show-rare"),this.showRare}get hasRare(){const e=e=>(e??[]).some(e=>!0===e?.rare);return(this.sections??[]).some(t=>!0===t?.rare||e(t?.groups)||(t?.groups??[]).some(t=>e(t?.fields)))}_layerOfProfile(){const e=this.viewProfiles.find(e=>e.id===this.viewProfile),t=e?.shared?"shared":"personal";return this.editableLayers.includes(t)?t:this.viewTarget}startConfiguringView(){return!!this.canConfigureView&&(this.configuring=!0,this.viewProfiles.length&&(this.viewTarget=this._layerOfProfile()),this.arrangementEntered={kind:this.viewTarget,revision:this._layerRevision(this.viewTarget),view:this._layerCopy(this.viewTarget)},this.resetAsked=!1,this.layerDraft=this._layerCopy(this.viewTarget),this._bindSectionDropTarget(),this.entryErrors=new Map,this.cancelEdit(),this.requestComponentUpdate("configuring"),this._readShownGroups("started"),this._focusAfterRender(['.sf-property-view-configure-bar [data-action="view-profile"]',".sf-property-view-configure-bar"]),!0)}stopConfiguringView(){const e=this.configuring;this.configuring=!1,this._bindSectionDropTarget(),this.layerDraft=null,this.arrangementEntered=null,this.resetAsked=!1,this.entryErrors=new Map,this.requestComponentUpdate("configuring"),e&&this._focusAfterRender('[data-action="menu"]')}_focusAfterRender(e){const t=e=>(e?.matches?.(p.FOCUSABLE)?e:e?.querySelector?.(p.FOCUSABLE))??null;this.whenRendered(()=>requestAnimationFrame(async()=>{const n=this.panelContent?.()??this;let i=null;for(const r of[e].flat()){const e=[...n?.querySelectorAll?.(r)??[]].pop()??null;if(e&&(i=t(e),!i&&e.localName.includes("-")&&(await customElements.whenDefined(e.localName),await(e.whenRendered?.()),await new Promise(e=>requestAnimationFrame(e)),i=t(e)),i))break}if(!i||!i.isConnected)return;const r=document.activeElement;r&&r!==document.body&&n?.contains?.(r)||i.focus({preventScroll:!0})}),{next:!0})}async cancelConfiguringView(){if(!this.configuring)return!1;const e=this.arrangementEntered;if(!e||e.kind!==this.viewTarget)return this.stopConfiguringView(),!0;const t=(e,t)=>JSON.stringify(e)===JSON.stringify(t),n=this._layerCopy(e.kind);if(null!=e.revision&&this._layerRevision(e.kind)===e.revision||t(n,e.view))return t(this.layerDraft,e.view)||await this.load("view-cancel"),this.stopConfiguringView(),!0;this.layerDraft=E(e.view);const i=await this.saveView();return await this.load("view-cancel"),this.stopConfiguringView(),i}askReset(){return!!this.configuring&&(this.resetAsked=!0,this.requestComponentUpdate("reset-ask"),!0)}cancelReset(){return this.resetAsked=!1,this.requestComponentUpdate("reset-ask"),!0}setViewTarget(e){return!(!this.editableLayers.includes(e)||e===this.viewTarget)&&(this.viewTarget=e,this.layerDraft=this._layerCopy(e),this.entryErrors=new Map,this.requestComponentUpdate("view-target"),!0)}canChangeVisibility(e){const t=e?.hiddenBy??null;return!t||"package"!==t&&("shared"!==t||"shared"===this.viewTarget)}entryError(e,t){return this.entryErrors.get(`${e}:${t}`)??null}_groupsOf(e){const t=this.sections.find(t=>String(t.key)===String(e));return Array.isArray(t?.groups)?t.groups:[]}_fieldsOf(e){for(const t of this.sections)for(const n of t.groups??[])if(String(n.key)===String(e))return Array.isArray(n.fields)?n.fields:[];return[]}_locateGroup(e){for(const t of this.sections)for(const n of t.groups??[])if(String(n.key)===String(e))return{section:t,group:n};return null}_writeOrder(e,t,n={}){t.forEach((t,i)=>{const r=String(t.key);e[r]={...e[r]??{},...n,order:i+1}})}moveFieldToSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const n=(this.sections??[]).find(e=>String(e.key)===String(t));if(!n)return!1;const i=(n.groups??[]).find(e=>"related"!==e.kind);return!!i&&this.moveField(e,String(i.key),(i.fields??[]).length)}_bindSectionDropTarget(){if(!this.configuring)return this._releaseSectionTarget?.(),void(this._releaseSectionTarget=null);if(this._releaseSectionTarget)return;const e=globalThis.SF?.Sortable?.registerSortableDropTarget;if("function"!=typeof e)return;const t=(e,t)=>{const n=globalThis.document?.elementFromPoint?.(e,t),i=n?.closest?.("[data-section-tab], .sf-tree-item[data-value]"),r=this.panelContent();return i&&r&&r.contains(i)?i:null};this._releaseSectionTarget=e({resolve:(e,n,i)=>{if(i?.group&&!["field","group"].includes(i.group))return null;const r=t(e,n);if(!r)return null;const s=r.getAttribute("data-section-tab")??r.getAttribute("data-value");if(s===this.selectedSection)return null;return{descriptor:{section:s},rect:(r.matches("[data-section-tab]")?r:r.querySelector(":scope > .sf-tree-item-container")||r).getBoundingClientRect(),label:r.querySelector(":scope > .sf-tree-item-container > .sf-tree-item-name")?.textContent?.trim()||r.textContent?.trim()||s}},drop:(e,t)=>!!t?.section&&("group"===e?.group?this.moveGroup(e?.item,t.section,Number.MAX_SAFE_INTEGER):this.moveFieldToSection(e?.item,t.section))})}moveField(e,t,n){if(!this.configuring||!this.layerDraft)return!1;const i=this._locateGroup(t);if(!i)return!1;let r=null,s=null;for(const t of this.sections){for(const n of t.groups??[]){const t=(n.fields??[]).findIndex(t=>String(t.key)===String(e));if(t>=0){s=n,[r]=n.fields.splice(t,1);break}}if(r)break}let o=!1;if(!r){const t=this.record?.unplaced??[],n=t.findIndex(t=>String(t.key)===String(e));n>=0&&([r]=t.splice(n,1),o=!0)}if(!r)return!1;const a=i.group.fields??(i.group.fields=[]),l=Math.max(0,Math.min(Number.isInteger(n)?n:a.length,a.length));return a.splice(l,0,r),this._writeOrder(this.layerDraft.fields,a,{group:String(t)}),o&&this._writeOrder(this.layerDraft.fields,this.record?.unplaced??[],{group:null}),s&&s!==i.group&&this._writeOrder(this.layerDraft.fields,s.fields??[],{group:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}moveGroup(e,t,n){if(!this.configuring||!this.layerDraft)return!1;const i=this.sections.find(e=>String(e.key)===String(t));if(!i)return!1;let r=null,s=null;for(const t of this.sections){const n=(t.groups??[]).findIndex(t=>String(t.key)===String(e));if(n>=0){s=t,[r]=t.groups.splice(n,1);break}}if(!r)return!1;const o=i.groups??(i.groups=[]),a=Math.max(0,Math.min(Number.isInteger(n)?n:o.length,o.length));return o.splice(a,0,r),this._writeOrder(this.layerDraft.groups,o,{section:String(t)}),s&&s!==i&&this._writeOrder(this.layerDraft.groups,s.groups??[],{section:String(s.key)}),this.requestComponentUpdate("view-move"),this.saveView()}setFieldView(e,t={}){if(!this.configuring||!this.layerDraft)return!1;const n=["width","variant","hint","label"],i=Object.fromEntries(Object.entries(t).filter(([e])=>n.includes(e)));if(!Object.keys(i).length)return!1;const r=String(e);this.layerDraft.fields[r]={...this.layerDraft.fields[r]??{},...i};for(const e of this.sections)for(const t of e.groups??[])for(const e of t.fields??[])String(e.key)===r&&Object.assign(e,i);return this.requestComponentUpdate("view-field"),this.saveView()}get sectionIcons(){return this.getAttribute("section-icons")||""}get sectionIconChoices(){const e=this.sectionIcons;return e?e.split(/[\s,]+/u).filter(Boolean):P}setSectionIcon(e,t){if(!this.configuring||!this.layerDraft)return!1;const n=String(e),i=this.sections.find(e=>String(e.key)===n);if(!i)return!1;const r=String(t??"").trim()||null;return this.layerDraft.sections[n]={...this.layerDraft.sections[n]??{},icon:r},i.icon=r,this.requestComponentUpdate("view-section-icon"),this.saveView()}renameEntry(e,t,n){if(!this.configuring||!this.layerDraft)return!1;const i={section:"sections",group:"groups"}[e];if(!i)return!1;const r=String(n??"").trim();if(!r)return!1;const s=this._findEntry(e,t);if(!s)return!1;const o=String(t);return this.layerDraft[i][o]={...this.layerDraft[i][o]??{},label:r},s.label=r,this.renaming=null,this.requestComponentUpdate("view-rename"),this.saveView()}startRenaming(e,t){return!!this.configuring&&(this.renaming={kind:e,key:String(t)},this.requestComponentUpdate("view-rename"),!0)}cancelRenaming(){this.renaming=null,this.requestComponentUpdate("view-rename")}removeGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this._locateGroup(e);if(!t||!this.canChangeVisibility(t.group))return!1;for(const e of[...t.group.fields??[]])this.moveFieldToUnplaced(String(e.key));const n=String(e);this.layerDraft.groups[n]={...this.layerDraft.groups[n]??{},hidden:!0},t.group.hidden=!0;const i=this.sections.find(e=>(e.groups??[]).includes(t.group));return i&&(i.groups=(i.groups??[]).filter(e=>e!==t.group)),this.requestComponentUpdate("view-remove-group"),this.saveView()}removeSection(e){if(!this.configuring||!this.layerDraft)return!1;const t=String(e),n=this.sections.find(e=>String(e.key)===t);if(!n||!this.canChangeVisibility(n))return!1;if(this.sections.length<2)return!1;const i=this.sections.find(e=>e!==n);for(const e of[...n.groups??[]])this.moveGroup(String(e.key),String(i.key),Number.MAX_SAFE_INTEGER);return this.layerDraft.sections[t]={...this.layerDraft.sections[t]??{},hidden:!0},n.hidden=!0,this.sections=this.sections.filter(e=>e!==n),this.selectedSection===t&&(this.selectedSection=String(i.key)),this.requestComponentUpdate("view-remove-section"),this.saveView()}moveSection(e,t){if(!this.configuring||!this.layerDraft)return!1;const n=String(e),i=this.sections.findIndex(e=>String(e.key)===n);if(i<0)return!1;const r=[...this.sections],[s]=r.splice(i,1),o=Math.max(0,Math.min(Number.isInteger(t)?t:r.length,r.length));return r.splice(o,0,s),!r.every((e,t)=>e===this.sections[t])&&(this.sections=r,this._writeOrder(this.layerDraft.sections,this.sections,{}),this.requestComponentUpdate("view-move-section"),this.saveView())}addGroup(e){if(!this.configuring||!this.layerDraft)return!1;const t=this.sections.find(t=>String(t.key)===String(e))??this.sections[0];if(!t)return!1;const n=this._newEntryKey("group"),i={key:n,label:this.newGroupTitle,columns:1,fields:[],hidden:!1,rare:!1,editable:!0};return t.groups=[...t.groups??[],i],this._writeOrder(this.layerDraft.groups,t.groups,{section:String(t.key)}),this.layerDraft.groups[n]={...this.layerDraft.groups[n]??{},label:i.label,section:String(t.key),columns:1,hidden:!1},this.renaming={kind:"group",key:n},this.requestComponentUpdate("view-add-group"),this.saveView()}addSection(){if(!this.configuring||!this.layerDraft)return!1;const e=this._newEntryKey("section"),t={key:e,label:this.newSectionTitle,groups:[],hidden:!1,rare:!1};return this.sections=[...this.sections,t],this._writeOrder(this.layerDraft.sections,this.sections,{}),this.layerDraft.sections[e]={...this.layerDraft.sections[e]??{},label:t.label,hidden:!1},this.selectedSection=e,this.renaming={kind:"section",key:e},this.requestComponentUpdate("view-add-section"),this.saveView()}_newEntryKey(e){return`view-${e}-${Date.now().toString(36)}${Math.floor(46655*Math.random()).toString(36).padStart(3,"0")}`}toggleEntryHidden(e,t){if(!this.configuring||!this.layerDraft)return!1;const n={section:"sections",group:"groups",field:"fields"}[e];if(!n)return!1;const i=this._findEntry(e,t);if(!i||!this.canChangeVisibility(i))return!1;const r=!i.hidden,s=String(t);return this.layerDraft[n][s]={...this.layerDraft[n][s]??{},hidden:r},i.hidden=r,this.requestComponentUpdate("view-hidden"),this.saveView()}_findEntry(e,t){const n=String(t);for(const t of this.sections){if("section"===e&&String(t.key)===n)return t;for(const i of t.groups??[]){if("group"===e&&String(i.key)===n)return i;for(const t of i.fields??[])if("field"===e&&String(t.key)===n)return t}}return null}async saveView(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this._viewWriting??Promise.resolve();let t;this._viewWriting=new Promise(e=>{t=e});try{return await e,await this._saveViewNow()}finally{t()}}async _saveViewNow(){if(!this.canConfigureView||!this.layerDraft)return null;const e=this.viewTarget,t=++this.viewEpoch,n=await this._raise("view.save",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)},view:E(this.layerDraft)},{stale:()=>t!==this.viewEpoch});return n?"applied"===n.answer?(this.entryErrors=new Map,this._storeLayer(e,n.revision??null,n.view??this.layerDraft),n.view?await this.load("view-normalised"):(this._setState("ready"),this.requestComponentUpdate("view-saved")),n):"conflict"===n.answer?(this._storeLayer(e,n.revision??null,n.view??null),this.message=n.message||this.viewConflictText,await this.load("view-conflict"),n):"refused"===n.answer?(this.entryErrors=new Map(Object.entries(n.entry_errors??{}).map(([e,t])=>[e,String(t)])),await this.load("view-refused"),n):(this._setState("error",n.message||(0,d.pageText)(L,"viewSaveFailedText",this)),n):null}_storeLayer(e,t,n){this.view&&(this.view.layers={...this.view.layers??{}},this.view.layers[e]={revision:t,view:n?E(n):null},this.layerDraft=this._layerCopy(e))}async resetView(){if(!this.canConfigureView)return null;this.resetAsked=!1,await(this._viewWriting??Promise.resolve());const e=this.viewTarget,t=++this.viewEpoch,n=await this._raise("view.reset",{record_id:null,collection:this.collection||null,target:{kind:e,revision:this._layerRevision(e)}},{stale:()=>t!==this.viewEpoch});return n?"applied"===n.answer||"conflict"===n.answer?("conflict"===n.answer&&(this.message=n.message||this.viewConflictText),this._storeLayer(e,n.revision??null,null),this.entryErrors=new Map,await this.load("view-reset"),n):(this._setState("error",n.message||(0,d.pageText)(L,"viewResetFailedText",this)),n):null}}(0,s.C3)(V,o),(0,s.l6)(V,o),V.define("sf-view-properties"),t()}catch(I){t(I)}})},"844bdc4d24eb"(e,t,n){n.d(t,{tm:()=>o});const i=Object.freeze(["eq","ne","in","not_in","empty","not_empty"]),r=e=>e&&"object"==typeof e&&!Array.isArray(e)&&"value"in e?e.value:e;function s(e,t){if(!e||"object"!=typeof e||Array.isArray(e))return null;for(const n of["all","any"]){if(!(n in e))continue;const i=e[n];if(!Array.isArray(i)||!i.length)return null;const r=i.map(e=>s(e,t));return r.includes(null)?null:"all"===n?r.every(Boolean):r.some(Boolean)}if("not"in e){const n=s(e.not,t);return null===n?null:!n}if("string"!=typeof e.field||!i.includes(e.op))return null;const n=(o=t.get(e.field),(Array.isArray(o)?o:[o]).map(r).filter(e=>null!=e&&""!==e).map(e=>String(e)));var o;if("empty"===e.op)return 0===n.length;if("not_empty"===e.op)return n.length>0;if("eq"===e.op||"ne"===e.op){const t=n.includes(String(r(e.value)));return"eq"===e.op?t:!t}if(!Array.isArray(e.value))return null;const a=e.value.map(e=>String(r(e))),l=n.some(e=>a.includes(e));return"in"===e.op?l:!l}function o(e,t){const n=e?.when&&"object"==typeof e.when?e.when:null,i=e=>n&&e in n?s(n[e],t):null,r=i("visible"),o=i("required"),a=i("enabled");return{visible:r??!0,required:o??!0===e?.required,enabled:a??!0}}},f44b979883f0(e,t,n){n.d(t,{Iv:()=>w,LI:()=>f,PD:()=>a,UD:()=>g,WQ:()=>p,dw:()=>m,e4:()=>s,lw:()=>d,nI:()=>o,uM:()=>h,zJ:()=>b});const i=/^([+-]?)(\d*)(?:[.,](\d*))?$/u,r=/[\s ']/gu;function s(e){if(null==e)return{ok:!0,value:null};if("number"==typeof e)return Number.isSafeInteger(e)?{ok:!0,value:String(e)}:{ok:!1};const t=String(e).replace(r,"");if(""===t)return{ok:!0,value:null};const n=i.exec(t);if(!n)return{ok:!1};const[,s,o,a]=n;if(""===o&&""===(a??""))return{ok:!1};const l=o.replace(/^0+(?=\d)/u,"")||"0",c=a??"",u=/^0*$/u.test(l+c);return{ok:!0,value:`${"-"!==s||u?"":"-"}${l}${c?`.${c}`:""}`}}function o(e){if(e&&"object"==typeof e&&"bigint"==typeof e.units)return e;const t=s(e);if(!t.ok||null===t.value)return null;const n=t.value.startsWith("-"),[i,r=""]=t.value.replace("-","").split(".");return{units:BigInt(i+r)*(n?-1n:1n),scale:r.length}}function a(e){const t=s(e);if(!t.ok||null===t.value)return 0;const n=t.value.indexOf(".");return-1===n?0:t.value.length-n-1}const l=new Map,c=e=>(l.has(e)||l.set(e,10n**BigInt(e)),l.get(e));function u(e,t){return e.scale===t?e:{units:e.units*c(t-e.scale),scale:t}}function d(e,t){return{units:e.units*t.units,scale:e.scale+t.scale}}function p(e,t){const n=Math.max(e.scale,t.scale);return{units:u(e,n).units+u(t,n).units,scale:n}}function h(e){return{units:e.units,scale:e.scale+2}}function f(e,t){if(e.scale<=t)return u(e,t);const n=c(e.scale-t),i=e.units<0n,r=i?-e.units:e.units;let s=r/n;return r%n*2n>=n&&(s+=1n),{units:i?-s:s,scale:t}}function g(e,t){const n=Math.max(e.scale,t.scale),i=u(e,n).units,r=u(t,n).units;return i===r?0:i<r?-1:1}function m(e){const t=e.units<0n,n=(t?-e.units:e.units).toString().padStart(e.scale+1,"0"),i=e.scale?n.slice(0,-e.scale):n,r=e.scale?n.slice(-e.scale):"",s=0n===e.units;return`${t&&!s?"-":""}${i}${r?`.${r}`:""}`}const v=new Map;function y(e){if(!v.has(e)){let t=" ",n=".";try{for(const i of new Intl.NumberFormat(e).formatToParts(12345.6))"group"===i.type&&(t=i.value),"decimal"===i.type&&(n=i.value)}catch{}v.set(e,{group:t,point:n})}return v.get(e)}function b(e,t,{minFraction:n=0}={}){const i=o(e);if(!i)return"";const r=m(i.scale<n?u(i,n):i),s=r.startsWith("-"),[a,l]=r.replace("-","").split("."),{group:c,point:d}=y(t);return`${s?"−":""}${a.replace(/\B(?=(\d{3})+(?!\d))/gu,c)}${l?`${d}${l}`:""}`}function w(e,t){const n=s(e);return n.ok&&null!==n.value?n.value.replace(".",y(t).point):""}},"62c5c417c97d"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{G:()=>l});var r=n("2a080a730149"),s=n("e5483002f3ea"),o=n("db94c32f22be"),a=e([r,s,o]);[r,s,o]=a.then?(await a)():a;function l(e,t,n,{disabled:i=!1}={}){const a=String(t.key??""),l={setFieldValue:(t,n)=>e.component.changeField(t,n),setFieldError:(t,n)=>e.component.reportFieldError(t,n),...e.canUploadFiles?{getFieldUploads:t=>e.component.getFieldUploads(t),startFieldUpload:(t,n)=>e.component.startFieldUpload(t,n),retryFieldUpload:(t,n)=>e.component.retryFieldUpload(t,n)}:{},...e.canPickRecords?{getFieldOptionsPage:t=>e.component.getFieldOptionsPage(t),getFieldOptionSearch:t=>e.component.getFieldOptionSearch(t),setFieldOptionSearch:(t,n)=>e.component.setFieldOptionSearch(t,n),loadFieldOptions:(t,n)=>e.component.loadFieldOptions(t,n)}:{}},c=(0,o.BE)(t,e.changed.has(a)&&n?e.changed.get(a):t.value,n,l,{node:e.component,size:e.size,viewHost:e.viewHost,disabled:i});if(null!==c)return c===r.nothing?r.html`<span class="sf-property-view-empty color-on-surface-variant">${e.emptyText}</span>`:c;const u=n?(0,s.z4)(t,e.changed.has(a)?e.changed.get(a):t.value,l,{size:e.size,...i?{disabled:!0}:{}}):(0,s.oX)(t,t.value,e.viewHost,{size:e.size}),d=["record","relation","user"].includes(t.propertyType||t.type)&&t.value&&"object"==typeof t.value;if(!n&&d&&u)return r.html`<span
|
|
577
589
|
class="sf-property-view-reference"
|
|
578
590
|
@click=${n=>{n.preventDefault(),n.stopPropagation(),e.component.openReference(t,t.value)}}
|
|
579
|
-
>${u}</span>`;if(n&&(null==u||u===r.nothing)){const n=(0,s.oX)(t,t.value,e.viewHost,{size:e.size});if(null!=n&&n!==r.nothing)return r.html`<span class="sf-property-view-readonly color-on-surface-variant" data-readonly="true">${n}</span>`}return null==u||u===r.nothing?r.html`<span class="sf-property-view-empty color-on-surface-variant">${e.emptyText}</span>`:u}i()}catch(c){i(c)}})},d69ebe7e288e(e,t,n){n.d(t,{Fr:()=>s,fL:()=>l,up:()=>o,xl:()=>a});var i=n("f44b979883f0");const r=new Map;function s(e,t){const n=`${e}|${t}`;if(!r.has(n)){let i=e,s=!1,o=2;try{const n=new Intl.NumberFormat(t,{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}),r=n.formatToParts(1),a=r.findIndex(e=>"currency"===e.type);i=r[a]?.value??e,s=a<r.findIndex(e=>"integer"===e.type),o=n.resolvedOptions().maximumFractionDigits}catch{}r.set(n,{sign:i,before:s,minor:o})}return r.get(n)}function o(e,t,n){if(!t)return(0,i.zJ)(e,n);const{sign:r,before:o,minor:a}=s(t,n),l=(0,i.zJ)(e,n,{minFraction:a});return l?o?`${r}${l}`:`${l} ${r}`:""}function a(e,t){return e&&"object"==typeof e&&!Array.isArray(e)?{amount:e.amount??null,currency:t||(e.currency??null)}:null==e||""===e?{amount:null,currency:t||null}:{amount:e,currency:t||null}}function l(e,t){const n=(0,i.zJ)(e,t);if(!n)return"";let r=!1;try{r=new Intl.NumberFormat(t,{style:"percent"}).formatToParts(.5).some(e=>"literal"===e.type&&/\s/u.test(e.value))}catch{r=!1}return`${n}${r?" ":""}%`}},"06dfc7b3b9d9"(e,t,n){n.d(t,{r5:()=>a});const i=Object.freeze(["inn","kpp","ogrn","bik","account","corr_account"]),r=e=>[...e].map(Number),s=(e,t)=>t.reduce((t,n,i)=>t+n*e[i],0);function o(e,t){return r(e+t).reduce((e,t,n)=>e+t*[7,1,3][n%3],0)%10==0}function a(e,t=i){const n={},a=e=>t.includes(e),l=t=>String(e?.[t]??""),c=l("inn"),u=l("kpp"),d=l("ogrn"),p=l("bik"),h=l("account"),f=l("corr_account");a("inn")&&(c?/^\d{10}$|^\d{12}$/u.test(c)?function(e){if(!/^\d{10}$|^\d{12}$/u.test(e))return!1;const t=r(e);if(10===e.length)return s(t,[2,4,10,3,5,9,4,6,8])%11%10===t[9];const n=s(t,[7,2,4,10,3,5,9,4,6,8])%11%10,i=s(t,[3,7,2,4,10,3,5,9,4,6,8])%11%10;return n===t[10]&&i===t[11]}(c)||(n.inn="innWrong"):n.inn="innLength":n.inn="innRequired");const g=12===c.length,m=10===c.length;a("kpp")&&u&&(/^\d{4}[\dA-Z]{2}\d{3}$/u.test(u)?g&&(n.kpp="kppPerson"):n.kpp="kppWrong"),a("ogrn")&&d&&(/^\d{13}$|^\d{15}$/u.test(d)?!function(e){if(!/^\d{13}$|^\d{15}$/u.test(e))return!1;const t=BigInt(e.slice(0,-1)),n=13===e.length?11n:13n;return Number(t%n%10n)===Number(e.at(-1))}(d)?n.ogrn="ogrnWrong":m&&13!==d.length?n.ogrn="ogrnOrganization":g&&15!==d.length&&(n.ogrn="ogrnPerson"):n.ogrn="ogrnLength");const v=/^04\d{7}$/u.test(p);return a("bik")&&p&&!v&&(n.bik="bikWrong"),a("account")&&h&&(/^\d{20}$/u.test(h)?v&&!o(p.slice(-3),h)&&(n.account="accountKey"):n.account="accountLength"),a("corr_account")&&f&&(/^\d{20}$/u.test(f)?f.startsWith("301")?v&&!o(`0${p.slice(4,6)}`,f)&&(n.corr_account="accountKey"):n.corr_account="corrStart":n.corr_account="accountLength"),n}n.d(t,["rS",0,i])},ebc72103d8b6(e,t,n){n.d(t,{GZ:()=>d,PL:()=>a,RO:()=>l,SK:()=>u,y4:()=>p});var i=n("f44b979883f0"),r=n("d69ebe7e288e");const s=new Set(["integer","number","percent","money"]);function o(e){const{settings:t,...n}=e??{},i=n.propertyType||n.type;return{...t&&"object"==typeof t?t:{},...n,propertyType:i,type:i}}function a(e){return(Array.isArray(e.columns)?e.columns:[]).map(o).filter(e=>e.key)}function l(e){return Array.isArray(e)?e.map(e=>e&&"object"==typeof e?e:{}):[]}function c(e,t){return null==t||""===t?null:"money"===e.propertyType?(0,i.nI)((0,r.xl)(t,e.currency).amount):(0,i.nI)(t)}function u(e,t){if(e.currency)return e.currency;if(e.compute?.of){const n=t.find(t=>e.compute.of.includes(t.key)&&"money"===t.propertyType);return n?.currency??null}return null}function d(e,t,n="en"){const s={},o={};for(const n of t)n.compute||Object.hasOwn(e,n.key)&&null!==e[n.key]&&""!==e[n.key]&&(s[n.key]=e[n.key]);for(const e of t){if(!e.compute||"multiply"!==e.compute.op||!Array.isArray(e.compute.of))continue;let a=null,l=null;for(const n of e.compute.of){const e=t.find(e=>e.key===n),o=e?c(e,s[n]):null;if(!o){a=null;break}"money"===e.propertyType&&(l=(0,r.xl)(s[n],e.currency).currency);const u="percent"===e.propertyType?(0,i.uM)(o):o;a=a?(0,i.lw)(a,u):u}if(a)if("money"===e.propertyType){const t=e.currency||l,s=t?(0,r.Fr)(t,n).minor:2;o[e.key]={amount:(0,i.dw)((0,i.LI)(a,s)),currency:t}}else{const t="integer"===e.propertyType?0:Number.isInteger(e.scale)?e.scale:2;o[e.key]=(0,i.dw)((0,i.LI)(a,t))}}return{...s,...o}}function p(e,t){const n={};for(const r of t){if("sum"!==r.total||!s.has(r.propertyType))continue;let t={units:0n,scale:0};for(const n of e){const e=c(r,n[r.key]);e&&(t=(0,i.WQ)(t,e))}n[r.key]=t}return n}n.d(t,["mk",0,s])},db94c32f22be(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{BE:()=>
|
|
591
|
+
>${u}</span>`;if(n&&(null==u||u===r.nothing)){const n=(0,s.oX)(t,t.value,e.viewHost,{size:e.size});if(null!=n&&n!==r.nothing)return r.html`<span class="sf-property-view-readonly color-on-surface-variant" data-readonly="true">${n}</span>`}return null==u||u===r.nothing?r.html`<span class="sf-property-view-empty color-on-surface-variant">${e.emptyText}</span>`:u}i()}catch(c){i(c)}})},d69ebe7e288e(e,t,n){n.d(t,{Fr:()=>s,fL:()=>l,up:()=>o,xl:()=>a});var i=n("f44b979883f0");const r=new Map;function s(e,t){const n=`${e}|${t}`;if(!r.has(n)){let i=e,s=!1,o=2;try{const n=new Intl.NumberFormat(t,{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}),r=n.formatToParts(1),a=r.findIndex(e=>"currency"===e.type);i=r[a]?.value??e,s=a<r.findIndex(e=>"integer"===e.type),o=n.resolvedOptions().maximumFractionDigits}catch{}r.set(n,{sign:i,before:s,minor:o})}return r.get(n)}function o(e,t,n){if(!t)return(0,i.zJ)(e,n);const{sign:r,before:o,minor:a}=s(t,n),l=(0,i.zJ)(e,n,{minFraction:a});return l?o?`${r}${l}`:`${l} ${r}`:""}function a(e,t){return e&&"object"==typeof e&&!Array.isArray(e)?{amount:e.amount??null,currency:t||(e.currency??null)}:null==e||""===e?{amount:null,currency:t||null}:{amount:e,currency:t||null}}function l(e,t){const n=(0,i.zJ)(e,t);if(!n)return"";let r=!1;try{r=new Intl.NumberFormat(t,{style:"percent"}).formatToParts(.5).some(e=>"literal"===e.type&&/\s/u.test(e.value))}catch{r=!1}return`${n}${r?" ":""}%`}},"06dfc7b3b9d9"(e,t,n){n.d(t,{r5:()=>a});const i=Object.freeze(["inn","kpp","ogrn","bik","account","corr_account"]),r=e=>[...e].map(Number),s=(e,t)=>t.reduce((t,n,i)=>t+n*e[i],0);function o(e,t){return r(e+t).reduce((e,t,n)=>e+t*[7,1,3][n%3],0)%10==0}function a(e,t=i){const n={},a=e=>t.includes(e),l=t=>String(e?.[t]??""),c=l("inn"),u=l("kpp"),d=l("ogrn"),p=l("bik"),h=l("account"),f=l("corr_account");a("inn")&&(c?/^\d{10}$|^\d{12}$/u.test(c)?function(e){if(!/^\d{10}$|^\d{12}$/u.test(e))return!1;const t=r(e);if(10===e.length)return s(t,[2,4,10,3,5,9,4,6,8])%11%10===t[9];const n=s(t,[7,2,4,10,3,5,9,4,6,8])%11%10,i=s(t,[3,7,2,4,10,3,5,9,4,6,8])%11%10;return n===t[10]&&i===t[11]}(c)||(n.inn="innWrong"):n.inn="innLength":n.inn="innRequired");const g=12===c.length,m=10===c.length;a("kpp")&&u&&(/^\d{4}[\dA-Z]{2}\d{3}$/u.test(u)?g&&(n.kpp="kppPerson"):n.kpp="kppWrong"),a("ogrn")&&d&&(/^\d{13}$|^\d{15}$/u.test(d)?!function(e){if(!/^\d{13}$|^\d{15}$/u.test(e))return!1;const t=BigInt(e.slice(0,-1)),n=13===e.length?11n:13n;return Number(t%n%10n)===Number(e.at(-1))}(d)?n.ogrn="ogrnWrong":m&&13!==d.length?n.ogrn="ogrnOrganization":g&&15!==d.length&&(n.ogrn="ogrnPerson"):n.ogrn="ogrnLength");const v=/^04\d{7}$/u.test(p);return a("bik")&&p&&!v&&(n.bik="bikWrong"),a("account")&&h&&(/^\d{20}$/u.test(h)?v&&!o(p.slice(-3),h)&&(n.account="accountKey"):n.account="accountLength"),a("corr_account")&&f&&(/^\d{20}$/u.test(f)?f.startsWith("301")?v&&!o(`0${p.slice(4,6)}`,f)&&(n.corr_account="accountKey"):n.corr_account="corrStart":n.corr_account="accountLength"),n}n.d(t,["rS",0,i])},ebc72103d8b6(e,t,n){n.d(t,{GZ:()=>d,PL:()=>a,RO:()=>l,SK:()=>u,y4:()=>p});var i=n("f44b979883f0"),r=n("d69ebe7e288e");const s=new Set(["integer","number","percent","money"]);function o(e){const{settings:t,...n}=e??{},i=n.propertyType||n.type;return{...t&&"object"==typeof t?t:{},...n,propertyType:i,type:i}}function a(e){return(Array.isArray(e.columns)?e.columns:[]).map(o).filter(e=>e.key)}function l(e){return Array.isArray(e)?e.map(e=>e&&"object"==typeof e?e:{}):[]}function c(e,t){return null==t||""===t?null:"money"===e.propertyType?(0,i.nI)((0,r.xl)(t,e.currency).amount):(0,i.nI)(t)}function u(e,t){if(e.currency)return e.currency;if(e.compute?.of){const n=t.find(t=>e.compute.of.includes(t.key)&&"money"===t.propertyType);return n?.currency??null}return null}function d(e,t,n="en"){const s={},o={};for(const n of t)n.compute||Object.hasOwn(e,n.key)&&null!==e[n.key]&&""!==e[n.key]&&(s[n.key]=e[n.key]);for(const e of t){if(!e.compute||"multiply"!==e.compute.op||!Array.isArray(e.compute.of))continue;let a=null,l=null;for(const n of e.compute.of){const e=t.find(e=>e.key===n),o=e?c(e,s[n]):null;if(!o){a=null;break}"money"===e.propertyType&&(l=(0,r.xl)(s[n],e.currency).currency);const u="percent"===e.propertyType?(0,i.uM)(o):o;a=a?(0,i.lw)(a,u):u}if(a)if("money"===e.propertyType){const t=e.currency||l,s=t?(0,r.Fr)(t,n).minor:2;o[e.key]={amount:(0,i.dw)((0,i.LI)(a,s)),currency:t}}else{const t="integer"===e.propertyType?0:Number.isInteger(e.scale)?e.scale:2;o[e.key]=(0,i.dw)((0,i.LI)(a,t))}}return{...s,...o}}function p(e,t){const n={};for(const r of t){if("sum"!==r.total||!s.has(r.propertyType))continue;let t={units:0n,scale:0};for(const n of e){const e=c(r,n[r.key]);e&&(t=(0,i.WQ)(t,e))}n[r.key]=t}return n}n.d(t,["mk",0,s])},db94c32f22be(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{BE:()=>Z});var r=n("2a080a730149"),s=n("e5483002f3ea"),o=n("43090d1c8307"),a=n("f44b979883f0"),l=n("d69ebe7e288e"),c=n("ebc72103d8b6"),u=n("06dfc7b3b9d9"),d=e([r,s,o]);[r,s,o]=d.then?(await d)():d;const p={en:{currency:"Currency",notNumber:"Enter a number",fractionMax:"At most {n} digits after the point",fractionNone:"A whole amount, no digits after the point",chooseCurrency:"Choose a currency",range:"From {min} to {max}",atLeast:"At least {min}",atMost:"At most {max}",addRow:"Add a row",removeRow:"Remove the row",rowUp:"Move the row up",rowDown:"Move the row down",row:"Row {n}",total:"Total",cellsWrong:"Some cells are not filled in correctly",rows:"{n} rows",row1:"1 row",inn:"INN",kpp:"KPP",ogrn:"OGRN",bik:"BIK",account:"Account",corr_account:"Correspondent account",innRequired:"The INN is required",innLength:"10 digits for an organisation, 12 for a person",innWrong:"The INN control digits do not match",kppWrong:"Nine characters: four digits, two digits or letters, three digits",kppPerson:"A person's INN has no KPP",ogrnLength:"13 digits (OGRN) or 15 (OGRNIP)",ogrnWrong:"The control digit does not match",ogrnOrganization:"An organisation has a 13-digit OGRN",ogrnPerson:"A person has a 15-digit OGRNIP",bikWrong:"Nine digits starting with 04",accountLength:"20 digits",accountKey:"The account does not match the BIK",corrStart:"A correspondent account starts with 301"},ru:{currency:"Валюта",notNumber:"Введите число",fractionMax:"Не больше {n} знаков после запятой",fractionNone:"Целая сумма, без знаков после запятой",chooseCurrency:"Выберите валюту",range:"От {min} до {max}",atLeast:"Не меньше {min}",atMost:"Не больше {max}",addRow:"Добавить строку",removeRow:"Удалить строку",rowUp:"Поднять строку",rowDown:"Опустить строку",row:"Строка {n}",total:"Итого",cellsWrong:"Не все ячейки заполнены верно",rows:"{n} строк",row1:"1 строка",inn:"ИНН",kpp:"КПП",ogrn:"ОГРН",bik:"БИК",account:"Расчётный счёт",corr_account:"Корр. счёт",innRequired:"ИНН обязателен",innLength:"10 цифр у организации, 12 у физлица",innWrong:"Не сходятся контрольные цифры ИНН",kppWrong:"Девять знаков: четыре цифры, две цифры или буквы, три цифры",kppPerson:"У ИНН физлица нет КПП",ogrnLength:"13 цифр (ОГРН) или 15 (ОГРНИП)",ogrnWrong:"Не сходится контрольная цифра",ogrnOrganization:"У организации ОГРН из 13 цифр",ogrnPerson:"У физлица ОГРНИП из 15 цифр",bikWrong:"Девять цифр, начиная с 04",accountLength:"20 цифр",accountKey:"Счёт не сходится с БИК",corrStart:"Корр. счёт начинается с 301"}},h="sf-view-properties";function f(e,t,n={}){let i=(0,o.pageText)(p,t,e,h);for(const[e,t]of Object.entries(n))i=i.replaceAll(`{${e}}`,String(t));return i}function g(e,t){const n=(0,o.pageLocale)(e);if(1===t)return f(e,"row1");if(n.startsWith("ru")){const e=t%100,n=t%10;if(n>=2&&n<=4&&(e<12||e>14))return`${t} строки`}return f(e,"rows",{n:t})}Object.freeze(["money","percent","items","compound","ru.requisites"]);const m=["RUB","USD","EUR","CNY","KZT","BYN","AED","TRY","GBP","JPY"],v=new WeakMap,y=e=>(v.has(e)||v.set(e,new Map),v.get(e)),b=new WeakMap,w=e=>(b.has(e)||b.set(e,new Set),b.get(e)),x=e=>e?.requestComponentUpdate?.("changed");function $(e,t,n,i){const r=y(e).get(t),s=(0,a.e4)(n);if(!s.ok)return String(n??"");if("string"==typeof r){const e=(0,a.e4)(r);if(e.ok&&e.value===s.value)return r}return(0,a.Iv)(s.value,i)}function k(e,t,{maxFraction:n=null,min:i=null,max:r=null}={}){const s=(0,a.e4)(t);if(!s.ok)return f(e,"notNumber");if(null===s.value)return null;if(null!==n&&(0,a.PD)(s.value)>n)return 0===n?f(e,"fractionNone"):f(e,"fractionMax",{n});const l=(0,a.nI)(s.value),c=(0,a.nI)(i),u=(0,a.nI)(r),d=(0,o.pageLocale)(e);return c&&(0,a.UD)(l,c)<0||u&&(0,a.UD)(l,u)>0?c&&u?f(e,"range",{min:(0,a.zJ)(i,d),max:(0,a.zJ)(r,d)}):c?f(e,"atLeast",{min:(0,a.zJ)(i,d)}):f(e,"atMost",{max:(0,a.zJ)(r,d)}):null}function S(e,{path:t,value:n,size:i,label:s,required:l,textEnd:c,placeholder:u,check:d,write:p}){const h=(0,o.pageLocale)(e),f=$(e,t,n,h),g=d(f),m=g&&w(e).has(t)?g:"",v=n=>{const i=n.target?.value??"";y(e).set(t,i);const r=(0,a.e4)(i);p(r.ok?r.value:i,d(i))};return r.html`
|
|
580
592
|
<sf-input
|
|
581
593
|
class="sf-view-fields-decimal"
|
|
582
594
|
size=${i}
|
|
@@ -610,7 +622,7 @@
|
|
|
610
622
|
@change=${t=>{const n=t.detail?.value||null;y(s).set(h,n);const i=p.amount;if(null!==i&&""!==i){const t=n?(0,l.Fr)(n,c).minor:null,r=k(s,i,{maxFraction:t,min:e.min??null,max:e.max??null})||(n?null:f(s,"chooseCurrency"));b((0,a.e4)(i).ok?(0,a.e4)(i).value:i,r,n)}else x(s)}}
|
|
611
623
|
></sf-dropdown>
|
|
612
624
|
</span>
|
|
613
|
-
`}function C(e,t,n){const i="string"==typeof e.currency&&e.currency?e.currency:null,{amount:r,currency:s}=(0,l.xl)(t,i);return null===r?"":(0,l.up)(r,s,n)}function z(e,t,n){const i=C(e,t,(0,o.pageLocale)(n.node));return i?r.html`<span class="sf-field-view sf-view-fields-amount">${i}</span>`:r.nothing}function E(e,t,n,i){return S(i.node,{path:i.path??String(e.key??""),value:t,size:i.size,label:e.label||e.key,required:e.required,textEnd:e.unit||"",placeholder:e.placeholder,check:t=>k(i.node,t,{min:e.min??null,max:e.max??null}),write:(t,i)=>{n.setFieldValue(e,t),n.setFieldError?.(e,i)}})}function q(e,t,n){const i=(0,a.zJ)(t,n);return i&&e.unit?`${i} ${e.unit}`:i}function L(e,t,n,i,o){if(null==t||""===t)return null;switch(e.propertyType){case"money":{const{amount:r,currency:s}=(0,l.xl)(t,(0,c.SK)(e,n));return null===r?null:(0,l.up)(r,s,i)}case"percent":return(0,l.fL)(t,i);case"number":return q(e,t,i);default:{const n=(0,s.oX)({...e,value:t},t,o,{size:"1"});return null===n||n===r.nothing?null:n}}}function
|
|
625
|
+
`}function C(e,t,n){const i="string"==typeof e.currency&&e.currency?e.currency:null,{amount:r,currency:s}=(0,l.xl)(t,i);return null===r?"":(0,l.up)(r,s,n)}function z(e,t,n){const i=C(e,t,(0,o.pageLocale)(n.node));return i?r.html`<span class="sf-field-view sf-view-fields-amount">${i}</span>`:r.nothing}function E(e,t,n,i){return S(i.node,{path:i.path??String(e.key??""),value:t,size:i.size,label:e.label||e.key,required:e.required,textEnd:e.unit||"",placeholder:e.placeholder,check:t=>k(i.node,t,{min:e.min??null,max:e.max??null}),write:(t,i)=>{n.setFieldValue(e,t),n.setFieldError?.(e,i)}})}function q(e,t,n){const i=(0,a.zJ)(t,n);return i&&e.unit?`${i} ${e.unit}`:i}function L(e,t,n,i,o){if(null==t||""===t)return null;switch(e.propertyType){case"money":{const{amount:r,currency:s}=(0,l.xl)(t,(0,c.SK)(e,n));return null===r?null:(0,l.up)(r,s,i)}case"percent":return(0,l.fL)(t,i);case"number":return q(e,t,i);default:{const n=(0,s.oX)({...e,value:t},t,o,{size:"1"});return null===n||n===r.nothing?null:n}}}function P(e,t,n,i){if("money"===e.propertyType){const r=(0,c.SK)(e,n);return(0,l.up)((0,a.dw)(t),r,i)}return"percent"===e.propertyType?(0,l.fL)((0,a.dw)(t),i):q(e,(0,a.dw)(t),i)}function O(e){switch(e.propertyType){case"boolean":return"minmax(4rem, auto)";case"integer":return"minmax(5.5rem, 0.6fr)";case"percent":return"minmax(6.5rem, 0.6fr)";case"number":return"minmax(6.5rem, 0.7fr)";case"money":return e.currency?"minmax(9rem, 0.9fr)":"minmax(13rem, 1.2fr)";case"date":return"minmax(9rem, 0.8fr)";case"choice":return"minmax(8rem, 1fr)";default:return"minmax(10rem, 2fr)"}}function V(e,t,n,i){const r=(0,o.pageLocale)(i.node),s=(0,c.y4)(t,n),a=n.find(e=>Object.hasOwn(s,e.key)&&"money"===e.propertyType)??n.find(e=>Object.hasOwn(s,e.key)),l=g(i.node,t.length);return a?`${l}, ${f(i.node,"total").toLowerCase()} ${P(a,s[a.key],n,r)}`:l}function I(e,t,n,i,{editing:a,host:l}){const u=i.node,d=(0,o.pageLocale)(u),p=String(e.key??""),h=Number.isInteger(e.minRows)?e.minRows:0,g=Number.isInteger(e.maxRows)?e.maxRows:1e3,m=a?[...t,...Array.from({length:Math.max(0,h-t.length)},()=>({}))]:t,v=(0,c.y4)(t,n),b=Object.keys(v).length>0,x=`${n.map(O).join(" ")}${a?" auto":""}`,$=D(u,p),k=()=>{const t=[...$.values()].some(Boolean);l.setFieldError?.(e,t?f(u,"cellsWrong"):null)},S=t=>{const i=t.map(e=>(0,c.GZ)(e,n,d));l.setFieldValue(e,i.length?i:null)},T=e=>{for(const e of[...y(u).keys()])e.startsWith(`${p}[`)&&y(u).delete(e);for(const e of[...w(u)])e.startsWith(`${p}[`)&&w(u).delete(e);$.clear(),k(),S(e)},A=(o,l,u)=>{const h=`${p}[${l}].${u.key}`,f=o[u.key];if(!a||u.compute||!0===e.readonly||!0===u.readonly){const e=L(u,u.compute&&a?(0,c.GZ)(o,n,d)[u.key]:f,n,d,i.viewHost);return r.html`<span class="sf-view-items-text ${u.compute?"color-on-surface-variant":""}" data-computed=${u.compute?"true":r.nothing}>${e??r.html`<span class="color-on-surface-variant">—</span>`}</span>`}const g={...u,key:h,label:u.label||u.key,value:f},v={setFieldValue:(e,n)=>((e,n,i)=>{const r=m.map(e=>({...e}));null==i||""===i?delete r[e][n.key]:r[e][n.key]=i,S(r.slice(0,Math.max(t.length,e+1)))})(l,u,n),setFieldError:(e,t)=>{$.set(h,t||null),k()}},y={...i,path:h};switch(u.propertyType){case"money":return F({...g,currency:u.currency},f,v,y);case"percent":return _(g,f,v,y);case"number":return E(g,f,v,y);default:return(0,s.z4)(g,f,v,{size:i.size})??r.html`<span class="sf-view-items-text">${L(u,f,n,d,i.viewHost)??"—"}</span>`}};return r.html`
|
|
614
626
|
<span class="sf-view-items-box">
|
|
615
627
|
<span class="sf-view-items ${a?"sf-view-items--edit":""}" data-items=${p} role="table"
|
|
616
628
|
aria-label=${e.label||p} style=${`--sf-view-items-columns: ${x}`}>
|
|
@@ -646,7 +658,7 @@
|
|
|
646
658
|
<span class="sf-view-items-row sf-view-items-totals" role="row" data-totals="true">
|
|
647
659
|
${n.map((e,t)=>r.html`
|
|
648
660
|
<span class="sf-view-items-cell ${c.mk.has(e.propertyType)?"sf-view-items-numeric":""} ${Object.hasOwn(v,e.key)?"":"sf-view-items-cell--blank"}" role="cell" data-column=${e.key}>
|
|
649
|
-
${Object.hasOwn(v,e.key)?r.html`<span class="sf-view-items-cell-label color-on-surface-variant" aria-hidden="true">${f(u,"total")}: ${e.label||e.key}</span><span class="sf-view-items-text sf-view-items-total">${
|
|
661
|
+
${Object.hasOwn(v,e.key)?r.html`<span class="sf-view-items-cell-label color-on-surface-variant" aria-hidden="true">${f(u,"total")}: ${e.label||e.key}</span><span class="sf-view-items-text sf-view-items-total">${P(e,v[e.key],n,d)}</span>`:0===t?r.html`<span class="sf-view-items-text sf-view-items-total-word">${f(u,"total")}</span>`:r.nothing}
|
|
650
662
|
</span>`)}
|
|
651
663
|
${a?r.html`<span role="cell"></span>`:r.nothing}
|
|
652
664
|
</span>`:r.nothing}
|
|
@@ -658,7 +670,7 @@
|
|
|
658
670
|
</span>`:r.nothing}
|
|
659
671
|
</span>
|
|
660
672
|
</span>
|
|
661
|
-
`}const R=new WeakMap;function D(e,t){R.has(e)||R.set(e,new Map);const n=R.get(e);return n.has(t)||n.set(t,new Map),n.get(t)}function
|
|
673
|
+
`}const R=new WeakMap;function D(e,t){R.has(e)||R.set(e,new Map);const n=R.get(e);return n.has(t)||n.set(t,new Map),n.get(t)}function N(e,t,n,i){return I(e,(0,c.RO)(t),(0,c.PL)(e),i,{editing:!0,host:n})}function M(e,t,n){const i=(0,c.RO)(t);return i.length?n.summary?r.html`<span class="sf-field-view">${V(0,i,(0,c.PL)(e),n)}</span>`:I(e,i,(0,c.PL)(e),n,{editing:!1,host:null}):r.nothing}const j={inn:12,kpp:9,ogrn:15,bik:9,account:20,corr_account:20};function U(e){const t=Array.isArray(e.parts)?e.parts.map(String):u.rS;return u.rS.filter(e=>t.includes(e))}function B(e){return(Array.isArray(e.parts)?e.parts:[]).map(e=>e&&"object"==typeof e?{...e,propertyType:e.propertyType||e.type}:null).filter(e=>e?.key)}function G(e){return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}function W(e,t){const n={};for(const i of e){const e=t[i];null!=e&&""!==e&&(n[i]=e)}return Object.keys(n).length?n:null}function H(e,t,n,i){const s=i.node,o=String(e.key??""),a=U(e),l=G(t),c=(0,u.r5)(l,a),d=(t,i)=>{const r="kpp"===t?i.replace(/\s/gu,"").toUpperCase():i.replace(/\D/gu,""),o=W(a,{...l,[t]:r}),c=(0,u.r5)(o??{},a),d=null===o&&!0!==e.required;n.setFieldValue(e,o),n.setFieldError?.(e,!d&&Object.keys(c).length?f(s,c[Object.keys(c)[0]]):null)};return r.html`
|
|
662
674
|
<span class="sf-view-fields-compound grid gap-1 w-full min-w-0" data-compound=${o}>
|
|
663
675
|
${a.map(t=>{const n=`${o}.${t}`,a=w(s).has(n),u=0===Object.keys(l).length&&!0!==e.required,p=a&&!u&&c[t]?f(s,c[t]):"";return r.html`
|
|
664
676
|
<span class="sf-view-fields-part flex flex-col gap-1/4 min-w-0 ${"account"===t||"corr_account"===t?"sf-view-fields-part--wide":""}" data-part=${t}>
|
|
@@ -681,13 +693,13 @@
|
|
|
681
693
|
</span>
|
|
682
694
|
`}function K(e,t,n){const i=G(t);return U(e).filter(e=>i[e]).map(e=>`${f(n,e)} ${i[e]}`).join(", ")}function J(e,t,n){const i=K(e,t,n.node);return i?r.html`<span class="sf-field-view">${i}</span>`:r.nothing}function Y(e,t,n,i){const o=i.node,a=String(e.key??""),l=B(e),c=l.map(e=>e.key),u=G(t),d=D(o,a);return r.html`
|
|
683
695
|
<span class="sf-view-fields-compound grid gap-1 w-full min-w-0" data-compound=${a}>
|
|
684
|
-
${l.map(t=>{const o=`${a}.${t.key}`,l={...t,key:o,label:t.label||t.key,readonly:!0===e.readonly||!0===t.readonly},p={setFieldValue:(i,r)=>n.setFieldValue(e,W(c,{...u,[t.key]:r})),setFieldError:(t,i)=>{d.set(o,i||null);const r=[...d.values()].find(Boolean);n.setFieldError?.(e,r??null)}},h={...i,path:o},f=
|
|
696
|
+
${l.map(t=>{const o=`${a}.${t.key}`,l={...t,key:o,label:t.label||t.key,readonly:!0===e.readonly||!0===t.readonly},p={setFieldValue:(i,r)=>n.setFieldValue(e,W(c,{...u,[t.key]:r})),setFieldError:(t,i)=>{d.set(o,i||null);const r=[...d.values()].find(Boolean);n.setFieldError?.(e,r??null)}},h={...i,path:o},f=Q[t.propertyType]?.edit(l,u[t.key],p,h)??(0,s.z4)(l,u[t.key],p,{size:i.size});return r.html`
|
|
685
697
|
<span class="sf-view-fields-part flex flex-col gap-1/4 min-w-0 ${"full"===t.width?"sf-view-fields-part--wide":""}" data-part=${t.key}>
|
|
686
698
|
<span class="sf-view-fields-part-label color-on-surface-variant">${l.label}${t.required?r.html`<span class="color-error" aria-hidden="true"> *</span>`:r.nothing}</span>
|
|
687
699
|
${f??r.nothing}
|
|
688
700
|
</span>`})}
|
|
689
701
|
</span>
|
|
690
|
-
`}function X(e,t,n){const i=G(t),o=B(e).filter(e=>null!==i[e.key]&&void 0!==i[e.key]&&""!==i[e.key]);return o.length?r.html`<span class="sf-field-view sf-view-fields-compound-view">${o.map((e,t)=>{const o=
|
|
702
|
+
`}function X(e,t,n){const i=G(t),o=B(e).filter(e=>null!==i[e.key]&&void 0!==i[e.key]&&""!==i[e.key]);return o.length?r.html`<span class="sf-field-view sf-view-fields-compound-view">${o.map((e,t)=>{const o=Q[e.propertyType]?.view({...e},i[e.key],n),a=o??(0,s.oX)({...e},i[e.key],n.viewHost,{size:n.size})??String(i[e.key]);return r.html`${t?", ":""}<span class="color-on-surface-variant">${e.label||e.key}</span> ${a}`})}</span>`:r.nothing}const Q={money:{edit:F,view:z},percent:{edit:_,view:A},items:{edit:N,view:M},compound:{edit:Y,view:X},"ru.requisites":{edit:H,view:J}};function Z(e,t,n,i,s){const o=Q[String(e.propertyType||e.type)];if(!o)return null;const a=n?null:s.viewHost?.formatFieldValue?.(e,t);return"string"==typeof a&&""!==a?r.html`<span class="sf-field-view">${a}</span>`:n&&!0!==e.readonly&&!0!==s.disabled&&i?.setFieldValue?o.edit(e,t,i,s):o.view(e,t,s)}i()}catch(ee){i(ee)}})},"40b137e60526"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{$:()=>X});var r=n("2a080a730149"),s=n("e5483002f3ea"),o=n("62c5c417c97d"),a=e([r,s,o]);[r,s,o]=a.then?(await a)():a;function l(e,t){return e.configuring?t??[]:e.visible(t)}function c(e){if(!e.canConfigureView)return r.nothing;if(!e.configuring)return r.nothing;const t=e.editableLayers??[],n=r.html`
|
|
691
703
|
<sf-profile-picker
|
|
692
704
|
size=${e.size}
|
|
693
705
|
data-action="view-profile"
|
|
@@ -1249,13 +1261,13 @@
|
|
|
1249
1261
|
${q(e)}
|
|
1250
1262
|
</div>
|
|
1251
1263
|
</header>
|
|
1252
|
-
`}const
|
|
1253
|
-
<div class="sf-property-view-edge flex ${
|
|
1264
|
+
`}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 V(e){return r.html`
|
|
1265
|
+
<div class="sf-property-view-edge flex ${O(e)?"flex-row":"flex-col"} gap-1/2" slot="edge"
|
|
1254
1266
|
aria-label=${e.closeLabel}>
|
|
1255
1267
|
<sf-button-icon
|
|
1256
1268
|
appearance="tonal"
|
|
1257
1269
|
scheme="on-surface"
|
|
1258
|
-
root-style=${
|
|
1270
|
+
root-style=${P}
|
|
1259
1271
|
size=${e.size}
|
|
1260
1272
|
icon="close"
|
|
1261
1273
|
data-action="close"
|
|
@@ -1266,7 +1278,7 @@
|
|
|
1266
1278
|
${e.address?r.html`
|
|
1267
1279
|
<sf-button-copy
|
|
1268
1280
|
appearance="tonal"
|
|
1269
|
-
root-style=${
|
|
1281
|
+
root-style=${P}
|
|
1270
1282
|
size=${e.size}
|
|
1271
1283
|
icon="link"
|
|
1272
1284
|
value=${e.addressUrl}
|
|
@@ -1282,7 +1294,7 @@
|
|
|
1282
1294
|
<sf-button-icon
|
|
1283
1295
|
appearance="tonal"
|
|
1284
1296
|
scheme="on-surface"
|
|
1285
|
-
root-style=${
|
|
1297
|
+
root-style=${P}
|
|
1286
1298
|
size=${e.size}
|
|
1287
1299
|
icon="open_in_full"
|
|
1288
1300
|
aria-label=${e.openFullLabel}
|
|
@@ -1333,7 +1345,7 @@
|
|
|
1333
1345
|
aria-label=${e.sectionIconText}
|
|
1334
1346
|
></sf-button-icon>
|
|
1335
1347
|
</sf-dropdown>
|
|
1336
|
-
`}function
|
|
1348
|
+
`}function N(e){const t=e.viewProfiles??[];return t.length?r.html`
|
|
1337
1349
|
<section class="sf-property-view-profiles flex flex-col gap-1/3">
|
|
1338
1350
|
<h3 class="sf-property-view-profiles-title">${e.viewProfileLabel}</h3>
|
|
1339
1351
|
${t.map(t=>r.html`
|
|
@@ -1363,7 +1375,7 @@
|
|
|
1363
1375
|
></sf-button-icon>
|
|
1364
1376
|
</div>
|
|
1365
1377
|
`)}
|
|
1366
|
-
${e.namingView?
|
|
1378
|
+
${e.namingView?M(e):r.html`
|
|
1367
1379
|
<sf-button
|
|
1368
1380
|
appearance="outline"
|
|
1369
1381
|
scheme="on-surface"
|
|
@@ -1373,7 +1385,7 @@
|
|
|
1373
1385
|
@click=${()=>e.component.startNamingView()}
|
|
1374
1386
|
></sf-button>`}
|
|
1375
1387
|
</section>
|
|
1376
|
-
`:r.nothing}function
|
|
1388
|
+
`:r.nothing}function M(e){const t=t=>{const n=t.target?.closest?.(".sf-property-view-rename")?.querySelector("sf-input");e.component.createViewProfile(n?.value??"")};return r.html`
|
|
1377
1389
|
<span class="sf-property-view-rename flex items-cross-center gap-1/4 min-w-0" data-action="new-profile">
|
|
1378
1390
|
<sf-input
|
|
1379
1391
|
size="1/2"
|
|
@@ -1417,7 +1429,7 @@
|
|
|
1417
1429
|
@click=${()=>e.component.addGroup(t?String(t.key):"")}
|
|
1418
1430
|
></sf-button>
|
|
1419
1431
|
${B(e)?r.nothing:U(e)}
|
|
1420
|
-
${
|
|
1432
|
+
${N(e)}
|
|
1421
1433
|
</div>
|
|
1422
1434
|
`}function U(e){return r.html`
|
|
1423
1435
|
<sf-button
|
|
@@ -1485,8 +1497,8 @@
|
|
|
1485
1497
|
label=${e.panelLabel||e.recordId||""}
|
|
1486
1498
|
>
|
|
1487
1499
|
${V(e)}
|
|
1488
|
-
<div class="sf-property-view-panel relative flex flex-col gap-2${t?" sf-property-view-panel--railed":""}${
|
|
1489
|
-
style=${
|
|
1500
|
+
<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":""}"
|
|
1501
|
+
style=${O(e)?`--sf-property-view--edge-room: calc(${e.edgeControlCount} * ${e.edgeControlWidth} + ${e.edgeControlCount-1} * var(--sf-space-1\\/2));`:r.nothing}
|
|
1490
1502
|
data-record-id=${e.recordId||""}
|
|
1491
1503
|
data-stack-depth=${String(e.stackDepth)}
|
|
1492
1504
|
data-stacked=${e.isTopPanel?"false":"true"}
|
|
@@ -1502,4 +1514,4 @@
|
|
|
1502
1514
|
${C(e,{panel:!0})}
|
|
1503
1515
|
</div>
|
|
1504
1516
|
</sf-drawer>
|
|
1505
|
-
`}i()}catch(Z){i(Z)}})},"2f31b00ad99a"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{x:()=>p});var r=n("e577837dd70a"),s=e([r]),o=s.then?(await s)():s;r=o[0];const a=/^(\d{4})-(\d{2})-(\d{2})$/u,l=/^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?$/u,c=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?$/u,u=new Set(["date","datetime","time"]);function d(e,t){const n=a.exec(t);if(n)return new Date(Number(n[1]),Number(n[2])-1,Number(n[3]));const i=l.exec(t);if(i)return"time"===e?new Date(2e3,0,1,Number(i[1]),Number(i[2]),Number(i[3]??0)):null;const r=c.exec(t);if(!r)return null;if(r[7]){const e=new Date(t.replace(" ","T"));return Number.isNaN(e.getTime())?null:e}return new Date(Number(r[1]),Number(r[2])-1,Number(r[3]),Number(r[4]),Number(r[5]),Number(r[6]??0))}function p(e,t,n){if(!u.has(e)||"string"!=typeof t||!t.trim())return"";const i=t.trim(),s=d(e,i);if(!s)return"";const o="date"!==e&&!a.test(i);return"time"===e?(0,r.Yq)(s,{date:null,time:"short",node:n}):(0,r.Yq)(s,{date:"medium",time:o?"short":null,node:n})}i()}catch(h){i(h)}})},"17828be41e75"(e,t,n){n.d(t,{C3:()=>s,l6:()=>o});const i=e=>String(e).replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase());function r(e,t){if(null==e||!0===e||e===t)return{outcome:"applied"};if(!1===e)return{outcome:"refused",reason:"refused"};if("object"==typeof e&&"string"==typeof e.outcome)return e;if("object"==typeof e&&"string"==typeof e.answer){const{answer:t,reason:n,message:i}=e;return{...e,outcome:t,...n?{reason:n}:{},...i?{message:i}:{}}}return{outcome:"applied",value:e}}function s(e,t){const n=e.prototype;for(const[e,s]of Object.entries(t.actions||{})){const t=i(e),o=n[t];if("function"!=typeof o||o.sfAction)continue;const a=Object.keys(s?.with||{}),l=function(...e){if(1===e.length&&(null!==(t=e[0])&&"object"==typeof t&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype)){const t=Object.keys(e[0]);a.length||t.length?a.length&&t.length&&t.every(e=>a.includes(e)||a.map(i).includes(e))&&(e=a.map(t=>e[0][t]??e[0][i(t)])):e=[]}var t;const n=o.apply(this,e);return n&&"function"==typeof n.then?n.then(e=>r(e,this)):r(n,this)};l.sfAction=!0,Object.defineProperty(n,t,{configurable:!0,writable:!0,value:l})}return e}function o(e,t){const n=e.prototype;for(const[e,r]of Object.entries(t.settings||{})){if(["list","object","state"].includes(r?.type))continue;const t=i(e);let s=n,o=null;for(;s&&s!==globalThis.HTMLElement?.prototype&&s!==Object.prototype&&(o=Object.getOwnPropertyDescriptor(s,t),!o);)s=Object.getPrototypeOf(s);o&&o.get&&!o.set&&Object.defineProperty(s,t,{configurable:!0,get:o.get,set(t){"boolean"===r.type?!0===t||""===t||"true"===t?this.setAttribute(e,""):!1===t&&!0===r.default?this.setAttribute(e,"false"):this.removeAttribute(e):null==t?this.removeAttribute(e):this.setAttribute(e,String(t))}})}return e}},"5b7d7695b41b"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("element-manifest",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("element-manifest",1).then(e,t),{once:!0}))},"18003344cff0"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("layer-stack",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("layer-stack",1).then(e,t),{once:!0}))},"073f05ff1a81"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1).then(e,t),{once:!0}))},"2a080a730149"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit",1).then(e,t),{once:!0}))},"43090d1c8307"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("page-language",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("page-language",1).then(e,t),{once:!0}))},deb1a4d61565(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("smart-base",1).then(e,t),{once:!0}))},"4284cc8c32e1"(e){e.exports=JSON.parse('{"$comment":"Dated aliases of sf-view-properties for the shim (core/js/aliases.js, standard §16 item 20).","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","aliases":[{"from":"aria-label","to":null,"kind":"attribute","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"host-attribute","section":"§3.1, §4.8","note":"stays a host attribute, read for the accessible name; no shim"},{"from":"sf-property-view-open-record","to":"sf-property-view-open","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 open","note":"ui-admin listens to it (src/polygon.ts:124); the detail {field, value, answer} is unchanged"},{"from":"sf-property-view-delete-record","to":"sf-property-view-delete","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 delete","note":"the detail {record_id, collection, revision, answer} is unchanged"},{"from":"sf-property-view","to":"sf-view-properties","kind":"tag","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","section":"rename plan R2 (ui-control RENAME-PLAN-2026-11-03), naming decision 2026-11-02","note":"the element is sf-view-properties; sf-property-view is a subclass defined beside it until the date"},{"from":"sf-property-view-close","to":"sf-view-properties-close","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open-full","to":"sf-view-properties-open-full","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-saved","to":"sf-view-properties-saved","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-failed","to":"sf-view-properties-failed","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open","to":"sf-view-properties-open","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-delete","to":"sf-view-properties-delete","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-created","to":"sf-view-properties-created","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-cancel","to":"sf-view-properties-cancel","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-state","to":"sf-view-properties-state","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-address-copy","to":"sf-view-properties-address-copy","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-favourite","to":"sf-view-properties-favourite","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"}]}')},"3ea81f4c3c20"(e){e.exports=JSON.parse('{"id":"smart.view-properties","tag":"sf-view-properties","version":"1.11.0","kind":"leaf","implements":["record-view@1"],"settings":{"add-field-text":{"type":"string","default-from":"runtime.add-field-text"},"add-group-text":{"type":"string","default-from":"runtime.add-group-text"},"add-section-text":{"type":"string","default-from":"runtime.add-section-text"},"back-label":{"type":"string","default-from":"runtime.back-label"},"cancel-configuring-text":{"type":"string","default-from":"runtime.cancel-configuring-text"},"cancel-name-text":{"type":"string","default-from":"runtime.cancel-name-text"},"cancel-text":{"type":"string","default-from":"runtime.cancel-text"},"changed-text":{"type":"string","default-from":"runtime.changed-text"},"close-label":{"type":"string","default-from":"runtime.close-label"},"collection":{"type":"string","default":""},"collection-icon":{"type":"icon","default":""},"collection-label":{"type":"string","default":""},"configure-hint-narrow-text":{"type":"string","default-from":"runtime.configure-hint-narrow-text"},"configure-hint-text":{"type":"string","default-from":"runtime.configure-hint-text"},"configure-text":{"type":"string","default-from":"runtime.configure-text"},"conflict-text":{"type":"string","default-from":"runtime.conflict-text"},"copy-link-label":{"type":"string","default-from":"runtime.copy-link-label"},"delete-text":{"type":"string","default-from":"runtime.delete-text"},"done-configuring-text":{"type":"string","default-from":"runtime.done-configuring-text"},"edit-text":{"type":"string","default-from":"runtime.edit-text"},"empty-record-text":{"type":"string","default-from":"runtime.empty-record-text"},"empty-text":{"type":"string","default-from":"runtime.empty-text"},"errors-text":{"type":"string","default-from":"runtime.errors-text"},"favourite":{"type":"boolean","default":false},"favourite-label":{"type":"string","default-from":"runtime.favourite-label"},"field-label-text":{"type":"string","default-from":"runtime.field-label-text"},"field-settings-text":{"type":"string","default-from":"runtime.field-settings-text"},"hidden-text":{"type":"string","default-from":"runtime.hidden-text"},"hide-rare-text":{"type":"string","default-from":"runtime.hide-rare-text"},"hint-text":{"type":"string","default-from":"runtime.hint-text"},"in-this-group-text":{"type":"string","default-from":"runtime.in-this-group-text"},"inherited-text":{"type":"string","default-from":"runtime.inherited-text"},"link-copied-label":{"type":"string","default-from":"runtime.link-copied-label"},"menu-label":{"type":"string","default-from":"runtime.menu-label"},"move-down-text":{"type":"string","default-from":"runtime.move-down-text"},"move-up-text":{"type":"string","default-from":"runtime.move-up-text"},"new-group-title":{"type":"string","default-from":"runtime.new-group-title"},"new-section-title":{"type":"string","default-from":"runtime.new-section-title"},"no-match-text":{"type":"string","default-from":"runtime.no-match-text"},"open-full-label":{"type":"string","default-from":"runtime.open-full-label"},"panel":{"type":"boolean","default":false},"panel-label":{"type":"string","default":""},"panel-size":{"type":"enum","values":["1/2","1","2","full"],"default":"1"},"size":{"type":"enum","values":["1","1/2"],"default":"1"},"mode":{"type":"enum","values":["view","auto","edit","create"],"default":"auto"},"panel-width":{"type":"string","default":""},"personal-layer-text":{"type":"string","default-from":"runtime.personal-layer-text"},"rare-text":{"type":"string","default-from":"runtime.rare-text"},"record-id":{"type":"id","default":""},"remove-field-text":{"type":"string","default-from":"runtime.remove-field-text"},"remove-group-text":{"type":"string","default-from":"runtime.remove-group-text"},"remove-section-text":{"type":"string","default-from":"runtime.remove-section-text"},"rename-text":{"type":"string","default-from":"runtime.rename-text"},"reset-view-ask-text":{"type":"string","default-from":"runtime.reset-view-ask-text"},"reset-view-text":{"type":"string","default-from":"runtime.reset-view-text"},"save-name-text":{"type":"string","default-from":"runtime.save-name-text"},"save-text":{"type":"string","default-from":"runtime.save-text"},"section-icon-text":{"type":"string","default-from":"runtime.section-icon-text"},"section-icons":{"type":"string","default":""},"sections-as":{"type":"enum","values":["list","tabs"],"default":"list"},"sections-label":{"type":"string","default-from":"runtime.sections-label"},"shared-layer-text":{"type":"string","default-from":"runtime.shared-layer-text"},"show-rare":{"type":"boolean","default":false},"show-rare-text":{"type":"string","default-from":"runtime.show-rare-text"},"shown-text":{"type":"string","default-from":"runtime.shown-text"},"unplaced-hint-text":{"type":"string","default-from":"runtime.unplaced-hint-text"},"unplaced-title":{"type":"string","default-from":"runtime.unplaced-title"},"variant-text":{"type":"string","default-from":"runtime.variant-text"},"view-conflict-text":{"type":"string","default-from":"runtime.view-conflict-text"},"view-denied-text":{"type":"string","default-from":"runtime.view-denied-text"},"width-text":{"type":"string","default-from":"runtime.width-text"},"view-profile-label":{"type":"string","default-from":"runtime.view-profile-label"},"add-view-text":{"type":"string","default-from":"runtime.add-view-text"},"new-view-text":{"type":"string","default-from":"runtime.new-view-text"},"delete-view-text":{"type":"string","default-from":"runtime.delete-view-text"},"last-shared-view-text":{"type":"string","default-from":"runtime.last-shared-view-text"},"full":{"type":"boolean","default":false},"open":{"type":"boolean","default":true}},"values":{"revision":{"type":"string"},"section":{"type":"string"}},"events":{"close":{"carries":{"reason":{"type":"enum","values":["close","escape","cancelled","deleted","api"]},"record_id":{"type":"id","nullable":true},"unsaved_fields":{"type":"list"}},"cancelable":true},"open-full":{"carries":{"id":"id","address":"string","record_id":{"type":"id","nullable":true}}},"saved":{"carries":{"id":"id","revision":{"type":"string","optional":true}}},"failed":{"carries":{"reason":"string","message":{"type":"string","optional":true}}},"open":{"carries":{"field":"string","value":"object","answer":"string"}},"delete":{"carries":{"collection":"string","revision":"string","answer":"string","record_id":{"type":"id","nullable":true}}},"created":{"carries":{"collection":{"type":"string","nullable":true},"record_id":{"type":"id","nullable":true}}},"cancel":{"carries":{"mode":{"type":"enum","values":["auto","edit","create"]},"scope":{"type":"enum","values":["group"],"optional":true},"section":{"type":"string","optional":true},"group":{"type":"string","optional":true}}},"state":{"carries":{"state":"string","message":"string"},"own-verb":true},"address-copy":{"carries":{},"own-verb":true},"favourite":{"carries":{"collection":{"type":"string","nullable":true},"favourite":"boolean","record_id":{"type":"id","nullable":true}},"own-verb":true}},"actions":{"refresh":{},"load":{"with":{"reason":{"type":"string","optional":true}}},"edit-group":{"with":{"section":"string","group":"string"}},"cancel-edit":{},"save-group":{"with":{"options":{"type":"object","optional":true}},"concurrency":"drop"},"select-section":{"with":{"key":"string"}},"close-panel":{"with":{"reason":{"type":"string","optional":true}}},"copy-address":{},"open-full-page":{},"confirm-save":{},"cancel-confirmation":{}},"port":{"id":"simai.property-view-port","version":"1.17.0","contract":"src/core/contracts/ports/simai.property-view-port/1.17.0/port.json"},"presentation":{"skeleton":{"file":"skeleton.html","late":[]}},"css-variables":{"--sf-property-view--sections-width":{"type":"length","state":"default"},"--sf-property-view--title-size":{"type":"length","state":"default"},"--sf-property-view--label-size":{"type":"length","state":"default"},"--sf-property-view--value-size":{"type":"length","state":"default"},"--sf-property-view--group-size":{"type":"length","state":"default"},"--sf-property-view--edge-room":{"type":"length","state":"open"}},"host-states":{"data-state":"string","aria-busy":"string"}}')},"99fb492b7fba"(e){e.exports=JSON.parse('{"title":"Property view","events":{"state":{"label":"Record state"},"address-copy":{"label":"Address copied"},"favourite":{"label":"Favourite"}},"runtime":{"add-field-text":"Add a field","add-group-text":"Add an area","add-section-text":"Add a section","add-view-text":"Add a view","back-label":"Back","cancel-configuring-text":"Cancel","cancel-name-text":"Leave the name","cancel-text":"Cancel","changed-text":"Fields changed","close-label":"Close","configure-hint-narrow-text":"Drag fields between groups. Applied at once.","configure-hint-text":"Drag fields between groups and onto a section on the left. Applied at once.","configure-text":"Arrange the view","confirm-save-text":"Confirm and save","conflict-text":"The record changed; read it again","copy-link-label":"Copy link","create-text":"Create","delete-text":"Delete","delete-view-text":"Remove the view","done-configuring-text":"Done","edit-text":"edit","empty-record-text":"This record has nothing to show","empty-text":"not filled in","errors-text":"Errors","favourite-label":"Favourite","field-label-text":"Name","field-settings-text":"Field settings","hidden-text":"Hide","hide-rare-text":"Hide rare fields","hint-text":"Hint","in-this-group-text":"In this area","inherited-text":"by default","keep-editing-text":"Keep editing","last-shared-view-text":"The only view everyone has","link-copied-label":"Link copied","menu-label":"More","move-down-text":"Move down","move-up-text":"Move up","new-group-title":"New area","new-section-title":"New section","new-view-text":"New view","no-match-text":"Nothing matches","open-full-label":"Open as a page","personal-layer-text":"Personal","rare-text":"rare","read-only-text":"You can only view this record","remove-field-text":"Remove from this area","remove-group-text":"Remove this area","remove-section-text":"Remove this section","rename-text":"Rename","reset-view-ask-text":"Reset the whole view?","reset-view-text":"Reset","save-failed-text":"The save failed","save-name-text":"Save the name","save-text":"Save","section-icon-text":"Section glyph","sections-label":"Sections","shared-layer-text":"Everyone\'s","show-rare-text":"Show rare fields","shown-text":"Shown","state-load-failed":"The record could not be read","state-loading":"Reading the record","state-port-not-connected":"The record port is not connected","state-unavailable":"The record is unavailable","unplaced-hint-text":"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out.","unplaced-title":"Not placed","variant-text":"Template","view-conflict-text":"The view changed and was read again","view-denied-text":"You may not change this layer","view-profile-label":"View","view-reset-failed-text":"The view could not be reset","view-save-failed-text":"The view could not be saved","width-text":"Full width"}}')},d614908e644f(e){e.exports=JSON.parse('{"title":"Запись","events":{"state":{"label":"Состояние записи"},"address-copy":{"label":"Адрес скопирован"},"favourite":{"label":"Избранное"}},"runtime":{"add-field-text":"Добавить поле","add-group-text":"Добавить область","add-section-text":"Добавить раздел","add-view-text":"Добавить вид","back-label":"Назад","cancel-configuring-text":"Отменить","cancel-name-text":"Оставить название","cancel-text":"Отменить","changed-text":"Изменено полей","close-label":"Закрыть","configure-hint-narrow-text":"Перетаскивайте поля между группами. Применяется сразу.","configure-hint-text":"Перетаскивайте поля между группами и на разделы слева. Применяется сразу.","configure-text":"Настроить вид","confirm-save-text":"Подтвердить и сохранить","conflict-text":"Запись изменилась, обновите её","copy-link-label":"Копировать ссылку","create-text":"Создать","delete-text":"Удалить","delete-view-text":"Удалить вид","done-configuring-text":"Готово","edit-text":"изменить","empty-record-text":"В этой записи нечего показать","empty-text":"не заполнено","errors-text":"Ошибок","favourite-label":"В избранное","field-label-text":"Название","field-settings-text":"Настройки поля","hidden-text":"Скрыть","hide-rare-text":"Скрыть редкие поля","hint-text":"Подсказка","in-this-group-text":"В этой области","inherited-text":"по умолчанию","keep-editing-text":"Вернуться к правке","last-shared-view-text":"Единственный общий вид","link-copied-label":"Ссылка скопирована","menu-label":"Ещё","move-down-text":"Ниже","move-up-text":"Выше","new-group-title":"Новая область","new-section-title":"Новый раздел","new-view-text":"Новый вид","no-match-text":"Ничего не найдено","open-full-label":"Открыть на всю страницу","personal-layer-text":"Персональный","rare-text":"редкое","read-only-text":"Эту запись можно только смотреть","remove-field-text":"Убрать из области","remove-group-text":"Удалить область","remove-section-text":"Удалить раздел","rename-text":"Переименовать","reset-view-ask-text":"Сбросить весь вид?","reset-view-text":"Сбросить","save-failed-text":"Не удалось сохранить","save-name-text":"Сохранить название","save-text":"Сохранить","section-icon-text":"Значок раздела","sections-label":"Разделы","shared-layer-text":"Для всех","show-rare-text":"Показать редкие поля","shown-text":"Показывать","state-load-failed":"Не удалось загрузить запись","state-loading":"Загрузка записи","state-port-not-connected":"Порт записи не подключён","state-unavailable":"Запись недоступна","unplaced-hint-text":"Поля, которых нет в этом виде. Перетащите поле в группу, чтобы разместить, или сюда, чтобы убрать.","unplaced-title":"Не размещённые","variant-text":"Вид","view-conflict-text":"Вид изменился, он перезагружен","view-denied-text":"Нет права менять этот слой","view-profile-label":"Вид","view-reset-failed-text":"Не удалось сбросить вид","view-save-failed-text":"Не удалось сохранить вид","width-text":"На всю ширину"}}')}};const t={};function n(i){const r=t[i];if(void 0!==r)return r.exports;const s=t[i]={exports:{}};return e[i](s,s.exports,n),s.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",i=e?Symbol("webpack exports"):"__webpack_exports__",r=e?Symbol("webpack error"):"__webpack_error__",s=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};n.a=(e,n,o)=>{let a;o&&((a=[]).d=-1);const l=new Set,c=e.exports;let u,d,p;const h=new Promise((e,t)=>{p=t,d=e});h[i]=c,h[t]=e=>(a&&e(a),l.forEach(e),h.catch(e=>{})),e.exports=h;n(e=>{let n;u=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const n=[];n.d=0,e.then(e=>{o[i]=e,s(n)},e=>{o[r]=e,s(n)});const o={};return o[t]=e=>e(n),o}}const n={};return n[t]=e=>{},n[i]=e,n}))(e);const o=()=>u.map(e=>{if(e[r])throw e[r];return e[i]}),c=new Promise(e=>{n=()=>e(o),n.r=0;const i=e=>e!==a&&!l.has(e)&&(l.add(e),e&&!e.d&&(n.r++,e.push(n)));u.map(e=>e[t](i))});return n.r?c:o()},e=>(e?p(h[r]=e):d(c),s(a))),a?.d<0&&(a.d=0)}})(),n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var r=t[i++],s=t[i++];n.o(e,r)?0===s&&i++:0===s?Object.defineProperty(e,r,{enumerable:!0,value:t[i++]}):Object.defineProperty(e,r,{enumerable:!0,get:s})}else for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);n("7623a90f1816")})();
|
|
1517
|
+
`}i()}catch(Q){i(Q)}})},"2f31b00ad99a"(e,t,n){n.a(e,async(e,i)=>{try{n.d(t,{x:()=>p});var r=n("e577837dd70a"),s=e([r]),o=s.then?(await s)():s;r=o[0];const a=/^(\d{4})-(\d{2})-(\d{2})$/u,l=/^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?$/u,c=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?$/u,u=new Set(["date","datetime","time"]);function d(e,t){const n=a.exec(t);if(n)return new Date(Number(n[1]),Number(n[2])-1,Number(n[3]));const i=l.exec(t);if(i)return"time"===e?new Date(2e3,0,1,Number(i[1]),Number(i[2]),Number(i[3]??0)):null;const r=c.exec(t);if(!r)return null;if(r[7]){const e=new Date(t.replace(" ","T"));return Number.isNaN(e.getTime())?null:e}return new Date(Number(r[1]),Number(r[2])-1,Number(r[3]),Number(r[4]),Number(r[5]),Number(r[6]??0))}function p(e,t,n){if(!u.has(e)||"string"!=typeof t||!t.trim())return"";const i=t.trim(),s=d(e,i);if(!s)return"";const o="date"!==e&&!a.test(i);return"time"===e?(0,r.Yq)(s,{date:null,time:"short",node:n}):(0,r.Yq)(s,{date:"medium",time:o?"short":null,node:n})}i()}catch(h){i(h)}})},"17828be41e75"(e,t,n){n.d(t,{C3:()=>s,l6:()=>o});const i=e=>String(e).replace(/-([a-z0-9])/gu,(e,t)=>t.toUpperCase());function r(e,t){if(null==e||!0===e||e===t)return{outcome:"applied"};if(!1===e)return{outcome:"refused",reason:"refused"};if("object"==typeof e&&"string"==typeof e.outcome)return e;if("object"==typeof e&&"string"==typeof e.answer){const{answer:t,reason:n,message:i}=e;return{...e,outcome:t,...n?{reason:n}:{},...i?{message:i}:{}}}return{outcome:"applied",value:e}}function s(e,t){const n=e.prototype;for(const[e,s]of Object.entries(t.actions||{})){const t=i(e),o=n[t];if("function"!=typeof o||o.sfAction)continue;const a=Object.keys(s?.with||{}),l=function(...e){if(1===e.length&&(null!==(t=e[0])&&"object"==typeof t&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype)){const t=Object.keys(e[0]);a.length||t.length?a.length&&t.length&&t.every(e=>a.includes(e)||a.map(i).includes(e))&&(e=a.map(t=>e[0][t]??e[0][i(t)])):e=[]}var t;const n=o.apply(this,e);return n&&"function"==typeof n.then?n.then(e=>r(e,this)):r(n,this)};l.sfAction=!0,Object.defineProperty(n,t,{configurable:!0,writable:!0,value:l})}return e}function o(e,t){const n=e.prototype;for(const[e,r]of Object.entries(t.settings||{})){if(["list","object","state"].includes(r?.type))continue;const t=i(e);let s=n,o=null;for(;s&&s!==globalThis.HTMLElement?.prototype&&s!==Object.prototype&&(o=Object.getOwnPropertyDescriptor(s,t),!o);)s=Object.getPrototypeOf(s);o&&o.get&&!o.set&&Object.defineProperty(s,t,{configurable:!0,get:o.get,set(t){"boolean"===r.type?!0===t||""===t||"true"===t?this.setAttribute(e,""):!1===t&&!0===r.default?this.setAttribute(e,"false"):this.removeAttribute(e):null==t?this.removeAttribute(e):this.setAttribute(e,String(t))}})}return e}},"5b7d7695b41b"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("element-manifest",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("element-manifest",1).then(e,t),{once:!0}))},"18003344cff0"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("layer-stack",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("layer-stack",1).then(e,t),{once:!0}))},"073f05ff1a81"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/unsafe-html.js",1).then(e,t),{once:!0}))},"2a080a730149"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit",1).then(e,t),{once:!0}))},"43090d1c8307"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("page-language",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("page-language",1).then(e,t),{once:!0}))},deb1a4d61565(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("smart-base",1).then(e,t),{once:!0}))},"4284cc8c32e1"(e){e.exports=JSON.parse('{"$comment":"Dated aliases of sf-view-properties for the shim (core/js/aliases.js, standard §16 item 20).","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","aliases":[{"from":"aria-label","to":null,"kind":"attribute","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"host-attribute","section":"§3.1, §4.8","note":"stays a host attribute, read for the accessible name; no shim"},{"from":"sf-property-view-open-record","to":"sf-property-view-open","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 open","note":"ui-admin listens to it (src/polygon.ts:124); the detail {field, value, answer} is unchanged"},{"from":"sf-property-view-delete-record","to":"sf-property-view-delete","kind":"event","component":"sf-view-properties","since":"2026-10-27","remove_after":"2026-12-01","mode":"same-detail","cancelable":false,"section":"§8, vocabulary §5 delete","note":"the detail {record_id, collection, revision, answer} is unchanged"},{"from":"sf-property-view","to":"sf-view-properties","kind":"tag","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","section":"rename plan R2 (ui-control RENAME-PLAN-2026-11-03), naming decision 2026-11-02","note":"the element is sf-view-properties; sf-property-view is a subclass defined beside it until the date"},{"from":"sf-property-view-close","to":"sf-view-properties-close","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open-full","to":"sf-view-properties-open-full","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-saved","to":"sf-view-properties-saved","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-failed","to":"sf-view-properties-failed","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-open","to":"sf-view-properties-open","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-delete","to":"sf-view-properties-delete","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-created","to":"sf-view-properties-created","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-cancel","to":"sf-view-properties-cancel","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-state","to":"sf-view-properties-state","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-address-copy","to":"sf-view-properties-address-copy","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"},{"from":"sf-property-view-favourite","to":"sf-view-properties-favourite","kind":"event","component":"sf-view-properties","since":"2026-11-03","remove_after":"2027-01-01","mode":"same-detail","section":"§8","note":"the event name carries the tag"}]}')},"3ea81f4c3c20"(e){e.exports=JSON.parse('{"id":"smart.view-properties","tag":"sf-view-properties","version":"1.11.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 n(i){const r=t[i];if(void 0!==r)return r.exports;const s=t[i]={exports:{}};return e[i](s,s.exports,n),s.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",i=e?Symbol("webpack exports"):"__webpack_exports__",r=e?Symbol("webpack error"):"__webpack_error__",s=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};n.a=(e,n,o)=>{let a;o&&((a=[]).d=-1);const l=new Set,c=e.exports;let u,d,p;const h=new Promise((e,t)=>{p=t,d=e});h[i]=c,h[t]=e=>(a&&e(a),l.forEach(e),h.catch(e=>{})),e.exports=h;n(e=>{let n;u=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const n=[];n.d=0,e.then(e=>{o[i]=e,s(n)},e=>{o[r]=e,s(n)});const o={};return o[t]=e=>e(n),o}}const n={};return n[t]=e=>{},n[i]=e,n}))(e);const o=()=>u.map(e=>{if(e[r])throw e[r];return e[i]}),c=new Promise(e=>{n=()=>e(o),n.r=0;const i=e=>e!==a&&!l.has(e)&&(l.add(e),e&&!e.d&&(n.r++,e.push(n)));u.map(e=>e[t](i))});return n.r?c:o()},e=>(e?p(h[r]=e):d(c),s(a))),a?.d<0&&(a.d=0)}})(),n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var r=t[i++],s=t[i++];n.o(e,r)?0===s&&i++:0===s?Object.defineProperty(e,r,{enumerable:!0,value:t[i++]}):Object.defineProperty(e,r,{enumerable:!0,get:s})}else for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);n("7623a90f1816")})();
|